示例#1
0
        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));
        }
示例#2
0
 public static void Raise(string message, RbacExceptionCategories exceptionCategory = RbacExceptionCategories.Core)
 {
     throw new RbacException(Format(message, exceptionCategory));
 }