diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 68dab61d..38fd72e0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,7 @@
-
+
@@ -31,7 +31,7 @@
-
+
@@ -51,8 +51,8 @@
-
-
+
+
@@ -63,8 +63,8 @@
-
-
+
+
@@ -72,6 +72,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -265,8 +278,8 @@
-
+
@@ -302,8 +315,6 @@
-
-
@@ -334,6 +345,8 @@
+
+
@@ -374,7 +387,7 @@
-
+
@@ -671,7 +684,8 @@
-
+
+
1481237183504
@@ -981,16 +995,20 @@
1512571595293
-
+
+ 1512882359925
+
+
+
+ 1512882359925
+
+
-
+
-
-
-
@@ -1003,6 +1021,9 @@
+
+
+
@@ -1017,7 +1038,7 @@
-
+
@@ -1030,7 +1051,6 @@
-
@@ -1042,12 +1062,12 @@
-
+
-
+
-
+
@@ -1074,7 +1094,6 @@
-
@@ -1099,7 +1118,8 @@
-
+
+
@@ -1438,16 +1458,26 @@
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -1457,24 +1487,14 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77f87173..18525337 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 1.1.0+2
+* Modified `handleAngelHttpException` to only run rescue code
+if the response is still open. Prevents application crashes.
+
# 1.1.0+1
* Modified `_matchesId` in `MapService` to support custom ID fields.
diff --git a/lib/src/http/server.dart b/lib/src/http/server.dart
index 89f530fc..f79239e4 100644
--- a/lib/src/http/server.dart
+++ b/lib/src/http/server.dart
@@ -370,10 +370,13 @@ class Angel extends AngelBase {
}
}
- res.statusCode = e.statusCode;
- var result = await errorHandler(e, req, res);
- await executeHandler(result, req, res);
- res.end();
+ if (res.isOpen) {
+ res.statusCode = e.statusCode;
+ var result = await errorHandler(e, req, res);
+ await executeHandler(result, req, res);
+ res.end();
+ }
+
return await sendResponse(request, req, res,
ignoreFinalizers: ignoreFinalizers == true);
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 38448f8e..76253c2c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: angel_framework
-version: 1.1.0+1
+version: 1.1.0+2
description: A high-powered HTTP server with DI, routing and more.
author: Tobe O
homepage: https://github.com/angel-dart/angel_framework