Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

exception handling in c# web api

catch (Exception ex)
            {
                _logger.LogError(ex.ToString());
                Response.AddApplicationError(ex.Message);
                return StatusCode(500, ex.Message);
            }
 
PREVIOUS NEXT
Tagged: #exception #handling #web #api
ADD COMMENT
Topic
Name
4+2 =