public WebErrorHandlerConfigurationAttribute(
            Type logHandler, string unhandledErrorMessage,
            bool returnRawException,
            Type exceptionDataContract)
        {
            if (logHandler != null && !logHandler.CastableAs<IWebLogHandler>())
                throw new Exception(string.Format("logHandler {0} must implement IWebLogHandler.", logHandler.Name));

            if (exceptionDataContract!= null && !exceptionDataContract.CastableAs<IWebExceptionDataContract>())
                throw new Exception(string.Format("unhandledErrorMessage {0} must implement IWebExceptionDataContract.", exceptionDataContract.Name));

            _behavior = new WebErrorHandlerConfigurationBehavior(logHandler, unhandledErrorMessage, returnRawException, exceptionDataContract);
        }
Example #2
0
        public WebErrorHandlerConfigurationAttribute(
            Type logHandler, string unhandledErrorMessage,
            bool returnRawException,
            Type exceptionDataContract)
        {
            if (logHandler != null && !logHandler.CastableAs <IWebLogHandler>())
            {
                throw new Exception(string.Format("logHandler {0} must implement IWebLogHandler.", logHandler.Name));
            }

            if (exceptionDataContract != null && !exceptionDataContract.CastableAs <IWebExceptionDataContract>())
            {
                throw new Exception(string.Format("unhandledErrorMessage {0} must implement IWebExceptionDataContract.", exceptionDataContract.Name));
            }

            _behavior = new WebErrorHandlerConfigurationBehavior(logHandler, unhandledErrorMessage, returnRawException, exceptionDataContract);
        }