public IActionResult Put([FromBody] AGSUserEntity user) { try { var result = _usersHelper.UpdateUser(user); return(AGSResponseFactory.GetAGSResponseJsonResult()); }catch (AGSException ex) { return(AGSResponseFactory.GetAGSExceptionJsonResult(ex)); }catch (Exception ex) { return(StatusCode(500)); } }
public IActionResult Error() { var error = HttpContext.Features.Get <IExceptionHandlerFeature>(); if (error != null) { var exception = error.Error; var agsException = exception as AGSException; // if it is AGSException, return response code if (agsException != null) { return(AGSResponseFactory.GetAGSExceptionJsonResult(agsException)); } else { // if it is other exceptions, shows error with http response code 500 return(Problem(exception.Message)); } } else { return(Problem()); } }