0
マイナンシー・サーバ・コードに基づいてWebアプリケーションにナンシー・エラー・メッセージから復帰しよう:クライアント側で
private dynamic GetSolution(dynamic arg)
{
string solutionName = arg.name;
if (solutionName == "error")
{
var response = Json(new {message = $"error"});
response.StatusCode = HttpStatusCode.BadRequest;
return response;
}
return Json(solutionService.GetSolutionByName(solutionName));
}
次とプロセス応答コード:
onButtonClicked(name: string): void
{
this
.solutionsService
.getSolutionByName(name)
.subscribe(
p=>this.showMessage(p.title),
p=>this.showError(p.message));
//this.refresh(true);
}
、予想されるオブジェクト(フィールドIDとタイトルとの溶液)を受信します
が、ステータスコード0エラー(例えば400)場合、私は予想外のオブジェクトを取得する:
私が間違って何?