|
@@ -130,7 +130,17 @@ class App { |
|
@@ -130,7 +130,17 @@ class App { |
130
|
|
130
|
|
131
|
}catch (\Throwable $exception){
|
131
|
}catch (\Throwable $exception){
|
132
|
|
132
|
|
133
|
- if(!($exception instanceof Err)){
|
133
|
+ if($exception instanceof Err){
|
|
|
134
|
+
|
|
|
135
|
+ if ($exception->getCode() !== 200){
|
|
|
136
|
+ $app->data = [
|
|
|
137
|
+ 'error_message' => $exception->getMessage(),
|
|
|
138
|
+ 'status' => $exception->getCode() ? $exception->getCode() : 500,
|
|
|
139
|
+ ];
|
|
|
140
|
+ }
|
|
|
141
|
+
|
|
|
142
|
+ }else{
|
|
|
143
|
+
|
134
|
$app->error = [
|
144
|
$app->error = [
|
135
|
'message' => $exception->getMessage(),
|
145
|
'message' => $exception->getMessage(),
|
136
|
'file' => $exception->getFile(),
|
146
|
'file' => $exception->getFile(),
|
|
@@ -143,11 +153,6 @@ class App { |
|
@@ -143,11 +153,6 @@ class App { |
143
|
'error_message' => $app->debug ? $exception->getMessage().PHP_EOL.$exception->getTraceAsString() : __('server_error'),
|
153
|
'error_message' => $app->debug ? $exception->getMessage().PHP_EOL.$exception->getTraceAsString() : __('server_error'),
|
144
|
'status' => $exception->getCode() ? $exception->getCode() : 500,
|
154
|
'status' => $exception->getCode() ? $exception->getCode() : 500,
|
145
|
];
|
155
|
];
|
146
|
- }else{
|
|
|
147
|
- $app->data = [
|
|
|
148
|
- 'error_message' => $exception->getMessage(),
|
|
|
149
|
- 'status' => $exception->getCode() ? $exception->getCode() : 500,
|
|
|
150
|
- ];
|
|
|
151
|
}
|
156
|
}
|
152
|
|
157
|
|
153
|
}
|
158
|
}
|