When you parse the string in JS you may get a string for the object instead of an object. This for example is bad. Instead, do stuff like this:
- context.Result = new JsonResult(new { Message = context.Exception.Message });
- string message = "An error at the API occurred. The specific error message is
being hidden from what the API exposes for security. If you have access to the
logs you may see a better description free from obfuscation therein.";
context.Result = new JsonResult(new { Message = message });
No comments:
Post a Comment