示例#1
0
 /// <summary>
 /// Handles the CMS exception.
 /// </summary>
 /// <param name="ex">The exception.</param>
 /// <param name="command">The command.</param>
 /// <param name="request">The request.</param>
 private static void HandleCmsException(CmsException ex, ICommandBase command, object request = null)
 {
     Log.Error(FormatCommandExceptionMessage(command, request), ex);
     if (command.Context != null)
     {
         command.Context.Messages.AddError(RootGlobalization.Message_InternalServerErrorPleaseRetry);
     }
 }
示例#2
0
        public void Throws_CmsException_If_Controller_Not_Inherits_CmsControllerBase()
        {
            CmsException ex = Assert.Throws <CmsException>(
                () =>
            {
                new HtmlHelper(new ViewContext(), new ViewPage()).MessagesBox("bcms-test-id");
            });

            Assert.IsInstanceOf <NotSupportedException>(ex.InnerException);
        }