diff options
Diffstat (limited to 'slips/src/app/Marina/Web/UnhandledExceptionsHttpModule.cs')
| -rw-r--r-- | slips/src/app/Marina/Web/UnhandledExceptionsHttpModule.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/slips/src/app/Marina/Web/UnhandledExceptionsHttpModule.cs b/slips/src/app/Marina/Web/UnhandledExceptionsHttpModule.cs new file mode 100644 index 0000000..d2267f2 --- /dev/null +++ b/slips/src/app/Marina/Web/UnhandledExceptionsHttpModule.cs @@ -0,0 +1,19 @@ +using System;
+using System.Web;
+using Marina.Infrastructure.Logging.Interfaces;
+using Marina.Web.Views;
+
+namespace Marina.Web {
+ public class UnhandledExceptionsHttpModule : IHttpModule {
+ public void Init( HttpApplication context ) {
+ context.Error += delegate {
+ foreach ( Exception exception in context.Context.AllErrors ) {
+ Log.For( this ).CriticalError( exception.ToString( ) );
+ }
+ Redirect.To( WebViews.Login );
+ };
+ }
+
+ public void Dispose() {}
+ }
+}
\ No newline at end of file |
