Patched handleAngelHttpException, bump to 1.1.0+2

This commit is contained in:
Tobe O 2017-12-12 13:28:52 -05:00
parent dc3c67b28d
commit 4657342569
4 changed files with 70 additions and 43 deletions

View file

@ -4,7 +4,7 @@
<list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/CHANGELOG.md" afterPath="$PROJECT_DIR$/CHANGELOG.md" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/src/http/map_service.dart" afterPath="$PROJECT_DIR$/lib/src/http/map_service.dart" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/src/http/server.dart" afterPath="$PROJECT_DIR$/lib/src/http/server.dart" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/pubspec.yaml" afterPath="$PROJECT_DIR$/pubspec.yaml" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
@ -31,7 +31,7 @@
<file leaf-file-name="service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<state relative-caret-position="420">
<caret line="36" column="37" lean-forward="false" selection-start-line="36" selection-start-column="37" selection-end-line="36" selection-end-column="37" />
<folding />
</state>
@ -51,8 +51,8 @@
<file leaf-file-name="map_service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/map_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="24" column="0" lean-forward="true" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<state relative-caret-position="330">
<caret line="24" column="0" lean-forward="false" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
@ -63,8 +63,8 @@
<file leaf-file-name="server.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1425">
<caret line="113" column="21" lean-forward="false" selection-start-line="113" selection-start-column="21" selection-end-line="113" selection-end-column="21" />
<state relative-caret-position="287">
<caret line="370" column="5" lean-forward="true" selection-start-line="370" selection-start-column="5" selection-end-line="370" selection-end-column="5" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
@ -72,6 +72,19 @@
</provider>
</entry>
</file>
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="75">
<caret line="5" column="32" lean-forward="false" selection-start-line="5" selection-start-column="32" selection-end-line="5" selection-end-column="32" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="services_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/services_test.dart">
<provider selected="true" editor-type-id="text-editor">
@ -265,8 +278,8 @@
<option value="$PROJECT_DIR$/test/extension_test.dart" />
<option value="$PROJECT_DIR$/test/all.dart" />
<option value="$PROJECT_DIR$/lib/src/http/service.dart" />
<option value="$PROJECT_DIR$/lib/src/http/server.dart" />
<option value="$PROJECT_DIR$/lib/src/http/map_service.dart" />
<option value="$PROJECT_DIR$/lib/src/http/server.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
</list>
@ -302,8 +315,6 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="Scratches" />
<pane id="AndroidView" />
<pane id="Scope">
<subPane subId="Project Files">
@ -334,6 +345,8 @@
<select />
</subPane>
</pane>
<pane id="ProjectPane" />
<pane id="Scratches" />
<pane id="PackagesPane" />
</panes>
</component>
@ -374,7 +387,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Dart Test.All Tests">
<component name="RunManager" selected="Dart Test.All Tests (PRODUCTION)">
<configuration name="Chained routes in routing_test.dart" type="DartTestRunConfigurationType" factoryName="Dart Test" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/test/routing_test.dart" />
<option name="scope" value="GROUP_OR_TEST_BY_NAME" />
@ -671,7 +684,8 @@
<workItem from="1511674447575" duration="576000" />
<workItem from="1511749291765" duration="8015000" />
<workItem from="1512570822083" duration="1079000" />
<workItem from="1512882177311" duration="166000" />
<workItem from="1512882177311" duration="187000" />
<workItem from="1513103172812" duration="146000" />
</task>
<task id="LOCAL-00001" summary="Re-designed exception">
<created>1481237183504</created>
@ -981,16 +995,20 @@
<option name="project" value="LOCAL" />
<updated>1512571595293</updated>
</task>
<option name="localTasksCounter" value="45" />
<task id="LOCAL-00045" summary="Patched _matchesId, bump to 1.1.0+1">
<created>1512882359925</created>
<option name="number" value="00045" />
<option name="presentableId" value="LOCAL-00045" />
<option name="project" value="LOCAL" />
<updated>1512882359925</updated>
</task>
<option name="localTasksCounter" value="46" />
<servers />
</component>
<component name="TestHistory">
<history-entry file="All_Tests - 2017.12.06 at 09h 45m 17s.xml">
<history-entry file="All_Tests - 2017.12.12 at 13h 27m 57s.xml">
<configuration name="All Tests" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="All_Tests_(PRODUCTION) - 2017.11.28 at 13h 08m 27s.xml">
<configuration name="All Tests (PRODUCTION)" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="All_Tests_(PRODUCTION) - 2017.11.28 at 13h 12m 22s.xml">
<configuration name="All Tests (PRODUCTION)" configurationId="DartTestRunConfigurationType" />
</history-entry>
@ -1003,6 +1021,9 @@
<history-entry file="All_Tests_(PRODUCTION) - 2017.12.06 at 09h 45m 26s.xml">
<configuration name="All Tests (PRODUCTION)" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="All_Tests_(PRODUCTION) - 2017.12.12 at 13h 28m 22s.xml">
<configuration name="All Tests (PRODUCTION)" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="only_match_route_with_matching_method_in_routing_test_dart - 2017.11.28 at 13h 05m 10s.xml">
<configuration name="only match route with matching method in routing_test.dart" configurationId="DartTestRunConfigurationType" />
</history-entry>
@ -1017,7 +1038,7 @@
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="116835000" />
<option name="totallyTimeSpent" value="117002000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -1030,7 +1051,6 @@
</component>
<component name="ToolWindowManager">
<frame x="126" y="23" width="1278" height="797" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32763532" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
@ -1042,12 +1062,12 @@
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34188035" sideWeight="0.5035524" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Dart Analysis" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.31196582" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.4002849" sideWeight="0.4964476" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4002849" sideWeight="0.4964476" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32905984" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.48005697" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.48005697" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2394822" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2435275" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="ANTLR Preview" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
@ -1074,7 +1094,6 @@
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Updated Travis script" />
<MESSAGE value="1.0.6" />
<MESSAGE value="Add stackTrace" />
<MESSAGE value="1.0.6+2" />
@ -1099,7 +1118,8 @@
<MESSAGE value="+9" />
<MESSAGE value="1.0.11" />
<MESSAGE value="Close #178, bump to 1.1.0" />
<option name="LAST_COMMIT_MESSAGE" value="Close #178, bump to 1.1.0" />
<MESSAGE value="Patched _matchesId, bump to 1.1.0+1" />
<option name="LAST_COMMIT_MESSAGE" value="Patched _matchesId, bump to 1.1.0+1" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
@ -1438,16 +1458,26 @@
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<state relative-caret-position="420">
<caret line="36" column="37" lean-forward="false" selection-start-line="36" selection-start-column="37" selection-end-line="36" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/map_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="24" column="0" lean-forward="false" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1425">
<caret line="113" column="21" lean-forward="false" selection-start-line="113" selection-start-column="21" selection-end-line="113" selection-end-column="21" />
<state relative-caret-position="287">
<caret line="370" column="5" lean-forward="true" selection-start-line="370" selection-start-column="5" selection-end-line="370" selection-end-column="5" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
@ -1457,24 +1487,14 @@
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="15">
<caret line="1" column="68" lean-forward="false" selection-start-line="1" selection-start-column="68" selection-end-line="1" selection-end-column="68" />
<first_editor relative-caret-position="75">
<caret line="5" column="32" lean-forward="false" selection-start-line="5" selection-start-column="32" selection-end-line="5" selection-end-column="32" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/map_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="24" column="0" lean-forward="true" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">

View file

@ -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.

View file

@ -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);
}

View file

@ -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 <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_framework