private static string Format(string message, RbacExceptionCategories exceptionCategory) { string prefix = string.Empty; switch (exceptionCategory) { case RbacExceptionCategories.Configuration: prefix = "RBAC.CNF"; break; case RbacExceptionCategories.Core: prefix = "RBAC.Core"; break; case RbacExceptionCategories.Parser: prefix = "RBAC.PRS"; break; case RbacExceptionCategories.QueryEngine: prefix = "RBAC.ENG"; break; case RbacExceptionCategories.Repository: prefix = "RBAC.REPO"; break; default: prefix = "RBAC"; break; } return(string.Format("{0} - {1}", prefix, message)); }
public static void Raise(string message, RbacExceptionCategories exceptionCategory = RbacExceptionCategories.Core) { throw new RbacException(Format(message, exceptionCategory)); }