Esempio n. 1
0
        public static void Enable(IPipelines pipelines, CustomErrorsConfiguration configuration, ISerializer serializer)
        {
            if (pipelines == null)
            {
                throw new ArgumentNullException("pipelines");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _configuration = configuration;

            pipelines.OnError.AddItemToEndOfPipeline(GetErrorHandler(configuration, serializer));
        }
Esempio n. 2
0
 private static Func <NancyContext, Exception, Response> GetErrorHandler(CustomErrorsConfiguration configuration, ISerializer serializer)
 {
     return((context, ex) => configuration.HandleError(context, ex, serializer));
 }
Esempio n. 3
0
 public static void Enable(IPipelines pipelines, CustomErrorsConfiguration configuration)
 {
     Enable(pipelines, configuration, new DefaultJsonSerializer());
 }