dart:mirrors is completely gone from Angel
This commit is contained in:
parent
edcbf9f639
commit
4017bc1682
2 changed files with 15 additions and 3 deletions
|
@ -2,7 +2,6 @@ library angel_framework.http.request_context;
|
|||
|
||||
import 'dart:async';
|
||||
import 'dart:io' show Cookie, HttpHeaders, HttpSession, InternetAddress;
|
||||
//import 'dart:mirrors';
|
||||
|
||||
import 'package:angel_container/angel_container.dart';
|
||||
import 'package:body_parser/body_parser.dart';
|
||||
|
|
|
@ -173,10 +173,21 @@ class AngelHttp {
|
|||
if (e is FormatException)
|
||||
throw new AngelHttpException.badRequest(message: e.message)
|
||||
..stackTrace = st;
|
||||
throw new AngelHttpException(e, stackTrace: st, statusCode: 500);
|
||||
throw new AngelHttpException(e,
|
||||
stackTrace: st,
|
||||
statusCode: 500,
|
||||
message: e?.toString() ?? '500 Internal Server Error');
|
||||
}, test: (e) => e is! AngelHttpException).catchError(
|
||||
(ee, StackTrace st) {
|
||||
var e = ee as AngelHttpException;
|
||||
|
||||
if (app.logger != null) {
|
||||
var error = e.error ?? e;
|
||||
var trace =
|
||||
new Trace.from(e.stackTrace ?? StackTrace.current).terse;
|
||||
app.logger.severe(e.message ?? e.toString(), error, trace);
|
||||
}
|
||||
|
||||
return handleAngelHttpException(
|
||||
e, e.stackTrace ?? st, req, res, request);
|
||||
});
|
||||
|
@ -201,7 +212,9 @@ class AngelHttp {
|
|||
e = error;
|
||||
} else {
|
||||
e = new AngelHttpException(error,
|
||||
stackTrace: stackTrace, message: error?.toString());
|
||||
stackTrace: stackTrace,
|
||||
message:
|
||||
error?.toString() ?? '500 Internal Server Error');
|
||||
}
|
||||
|
||||
if (app.logger != null) {
|
||||
|
|
Loading…
Reference in a new issue