Example #1
0
 /// <summary>
 /// Default overloaded constructor to set the custom exception message
 /// based on the passed exception type.
 /// </summary>
 /// <param name="type">Type of exception of type RapidExceptionType enum</param>
 /// <param name="category">Category of exception</param>
 public FoundationException(ExceptionTypes type, ExceptionCategories category, System.Exception ex)
 {
     ExceptionCode     = GetExceptionCode(type);
     ExceptionType     = type;
     ExceptionCategory = category;
     OriginalException = ex;
 }
 public HandleExceptionAttribute(ExceptionTypes type, ExceptionCategories category)
 {
     // Errors come here before other error filters
     Order = 1;
     _rapidExceptionType     = type;
     _rapidExceptionCategory = category;
 }
 public ExceptionMessageAttribute(int errorCode, ExceptionCategories category, string message, HttpStatusCode statusCode)
 {
     this.Title      = category.DisplayName();
     this.Message    = message;
     this.StatusCode = statusCode;
     this.ErrorCode  = errorCode;
 }
Example #4
0
        public static string DisplayName(this ExceptionCategories exceptionCategories)
        {
            switch (exceptionCategories)
            {
            case ExceptionCategories.AuthenticationError:

                return("Authentication error");

            case ExceptionCategories.GeneralError:

                return("General error");
            }

            return(string.Empty);
        }
Example #5
0
 /// <summary>
 /// Default overloaded constructor to set the custom exception message
 /// based on the passed exception type.
 /// </summary>
 /// <param name="type">Type of exception of type RapidExceptionType enum</param>
 /// <param name="category">Category of exception</param>
 public FoundationException(ExceptionTypes type, ExceptionCategories category)
 {
     ExceptionCode     = GetExceptionCode(type);
     ExceptionType     = type;
     ExceptionCategory = category;
 }