Example #1
0
        private ActionResult Error(RedirectsException ex)
        {
            // Initialize a new error model based on the exception
            RedirectsError body = new RedirectsError(ex);

            return(new JsonResult(body)
            {
                StatusCode = (int)ex.StatusCode
            });
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance based on the specified <paramref name="exception"/>.
 /// </summary>
 /// <param name="exception">The exception.</param>
 public RedirectsError(RedirectsException exception)
 {
     StatusCode = exception.StatusCode;
     Error      = exception.Message;
 }