public ErrorHandlerAttribute(
            Type errorHandler,
            string unhandledErrorMessage,
            bool returnRawException)
        {
            if (!errorHandler.CastableAs<IErrorHandler>())
                throw new Exception("errorHandler must implement IErrorHandler.");

            _behavior = new ErrorHandlerBehavior(errorHandler, unhandledErrorMessage, returnRawException);
        }
示例#2
0
        public ErrorHandlerAttribute(
            Type errorHandler,
            string unhandledErrorMessage,
            bool returnRawException)
        {
            if (errorHandler != null && !errorHandler.CastableAs <IErrorHandler>())
            {
                throw new Exception("errorHandler must implement IErrorHandler.");
            }

            _behavior = new ErrorHandlerBehavior(errorHandler, unhandledErrorMessage, returnRawException);
        }