Created
November 16, 2018 10:32
-
-
Save victorjonsson/ecd1146b427e65c66daca8b500fcc104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SomethingController([FromBody] MyDataModel model) { | |
try { | |
DoTheStuff(model); | |
} catch (SpecificExceptionIKnowCanHappen exc) { | |
return BadRequest(new { errorCode = ErrorCode }); | |
} | |
// all other exceptions will let the app crash, exception info will be sen to log and app returns status 500 to the client | |
return Ok(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment