public
Description: Midgard Components Framework 3rd generation
Homepage: http://www.midgard-project.org
Clone URL: git://github.com/bergie/midcom.git
Added some kind of output when dispating fails for some reason
Tero Heikkinen (author)
Sat Jul 05 12:27:01 -0700 2008
commit  c3d7a22513def37d29455c75ee42c63e741363f3
tree    64b430932224ac89beeecc880f47d9ee47c154a6
parent  a31ec8170fa500ae76dcd3bb4f32889c04a2e27f
...
24
25
26
27
28
29
30
...
116
117
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
120
121
...
24
25
26
 
27
28
29
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
0
@@ -24,7 +24,6 @@ class midcom_core_exceptionhandler
0
             case 'midcom_exception_httperror':
0
                 $http_code = $exception->getCode();
0
                 break;
0
-
0
             default:
0
                 $http_code = 500;
0
                 break;
0
@@ -116,6 +115,22 @@ class midcom_exception_notfound extends Exception
0
     }
0
 }
0
 
0
+class midcom_exception_allroutesfailed extends Exception
0
+{
0
+ // FIXME: Some more elegant way to output the worst failure
0
+ // Redefine the exception so message isn't optional
0
+ public function __construct($message, $code = 500)
0
+ {
0
+ $string = ("Exception message stack");
0
+ foreach($message as $m)
0
+ {
0
+ $string .= "{$m->message}\n";
0
+ }
0
+ $message = $string;
0
+ parent::__construct($message, $code);
0
+ }
0
+}
0
+
0
 /**
0
  * MidCOM 3 "unauthorized" exception
0
  *
...
246
247
248
249
 
250
251
252
...
246
247
248
 
249
250
251
252
0
@@ -246,7 +246,7 @@ class midcom_core_services_dispatcher_midgard implements midcom_core_services_di
0
             /**
0
               * @Todo: Dump better output if all routematches fail to handle
0
               */
0
- throw new midcom_exception_notfound('All routes failed to handle the request');
0
+ throw new midcom_exception_allroutesfailed(&$this->exceptions_stack);
0
         }
0
     }
0
     

Comments

    No one has commented yet.