I love stack overflows!!!

This commit is contained in:
thosakwe 2016-12-30 21:22:54 -05:00
parent e09050f116
commit c771e82ad3
5 changed files with 300 additions and 150 deletions

View file

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="DI Tests" type="DartTestRunConfigurationType" factoryName="Dart Test" singleton="true"> <configuration default="false" name="DI Tests" type="DartTestRunConfigurationType" factoryName="Dart Test" singleton="true">
<option name="filePath" value="$PROJECT_DIR$/test/di.dart" /> <option name="filePath" value="$PROJECT_DIR$/test/di_test.dart" />
<method /> <method />
</configuration> </configuration>
</component> </component>

View file

@ -2,7 +2,11 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment=""> <list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/runConfigurations/DI_Tests.xml" afterPath="$PROJECT_DIR$/.idea/runConfigurations/DI_Tests.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/src/http/angel_http_exception.dart" afterPath="$PROJECT_DIR$/lib/src/http/angel_http_exception.dart" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/src/http/controller.dart" afterPath="$PROJECT_DIR$/lib/src/http/controller.dart" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/src/http/memory_service.dart" afterPath="$PROJECT_DIR$/lib/src/http/memory_service.dart" />
</list> </list>
<ignored path="$PROJECT_DIR$/.tmp/" /> <ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" /> <ignored path="$PROJECT_DIR$/temp/" />
@ -23,35 +27,14 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="hooked_service.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="routing_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/hooked_service.dart"> <entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675"> <state relative-caret-position="0">
<caret line="49" column="5" lean-forward="false" selection-start-line="49" selection-start-column="5" selection-end-line="49" selection-end-column="5" /> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding /> <folding>
</state> <element signature="e#0#17#0" expanded="true" />
</provider> </folding>
</entry>
</file>
<file leaf-file-name="pubspec.yaml" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="1" column="21" lean-forward="false" selection-start-line="1" selection-start-column="21" selection-end-line="1" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.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="39" lean-forward="false" selection-start-line="5" selection-start-column="39" selection-end-line="5" selection-end-column="39" />
<folding />
</first_editor>
<second_editor />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -59,31 +42,48 @@
<file leaf-file-name="response_context.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="response_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/response_context.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/response_context.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2175"> <state relative-caret-position="165">
<caret line="153" column="25" lean-forward="false" selection-start-line="153" selection-start-column="25" selection-end-line="153" selection-end-column="25" /> <caret line="208" column="26" lean-forward="true" selection-start-line="208" selection-start-column="26" selection-end-line="208" selection-end-column="26" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="server.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="angel_http_exception.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http_exception.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="474">
<caret line="77" column="0" lean-forward="true" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="server.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/http/server.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/server.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3555"> <state relative-caret-position="175">
<caret line="237" column="49" lean-forward="false" selection-start-line="237" selection-start-column="49" selection-end-line="237" selection-end-column="49" /> <caret line="237" column="42" lean-forward="true" selection-start-line="237" selection-start-column="42" selection-end-line="237" selection-end-column="42" />
<folding> <folding>
<element signature="e#38#58#0" expanded="true" /> <element signature="e#38#58#0" expanded="true" />
<marker date="1483149636000" expanded="true" signature="14571:14573" ph="{...}" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="routable.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="memory_service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/routable.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/memory_service.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1260"> <state relative-caret-position="444">
<caret line="94" column="26" lean-forward="false" selection-start-line="94" selection-start-column="26" selection-end-line="94" selection-end-column="26" /> <caret line="74" column="26" lean-forward="true" selection-start-line="74" selection-start-column="26" selection-end-line="74" selection-end-column="26" />
<folding /> <folding>
<marker date="1483150602000" expanded="true" signature="331:2888" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="889:1201" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="1605:2124" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="2172:2586" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="2628:2886" ph="{...}" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -110,11 +110,33 @@
</file> </file>
<file leaf-file-name="controller_test.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="controller_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/controller_test.dart"> <entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="385">
<caret line="70" column="2" lean-forward="false" selection-start-line="70" selection-start-column="2" selection-end-line="70" selection-end-column="2" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="controller.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/controller.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315">
<caret line="86" column="35" lean-forward="true" selection-start-line="86" selection-start-column="35" selection-end-line="86" selection-end-column="35" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="di_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/di_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#22#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -136,16 +158,18 @@
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/.gitignore" /> <option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http_exception.dart" />
<option value="$PROJECT_DIR$/lib/src/http/routable.dart" /> <option value="$PROJECT_DIR$/lib/src/http/routable.dart" />
<option value="$PROJECT_DIR$/test/common.dart" /> <option value="$PROJECT_DIR$/test/common.dart" />
<option value="$PROJECT_DIR$/test/hooked_test.dart" /> <option value="$PROJECT_DIR$/test/hooked_test.dart" />
<option value="$PROJECT_DIR$/lib/src/http/hooked_service.dart" /> <option value="$PROJECT_DIR$/lib/src/http/hooked_service.dart" />
<option value="$PROJECT_DIR$/lib/src/http/response_context.dart" />
<option value="$PROJECT_DIR$/lib/src/http/server.dart" /> <option value="$PROJECT_DIR$/lib/src/http/server.dart" />
<option value="$PROJECT_DIR$/lib/src/http/fatal_error.dart" /> <option value="$PROJECT_DIR$/lib/src/http/fatal_error.dart" />
<option value="$PROJECT_DIR$/README.md" /> <option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/pubspec.yaml" /> <option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/http/response_context.dart" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http_exception.dart" />
<option value="$PROJECT_DIR$/lib/src/http/memory_service.dart" />
<option value="$PROJECT_DIR$/lib/src/http/controller.dart" />
</list> </list>
</option> </option>
</component> </component>
@ -156,10 +180,10 @@
<sorting>DEFINITION_ORDER</sorting> <sorting>DEFINITION_ORDER</sorting>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="241" /> <option name="x" value="324" />
<option name="y" value="49" /> <option name="y" value="73" />
<option name="width" value="1621" /> <option name="width" value="1486" />
<option name="height" value="830" /> <option name="height" value="909" />
</component> </component>
<component name="ProjectLevelVcsManager"> <component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" /> <ConfirmationsSetting value="2" id="Add" />
@ -277,7 +301,7 @@
<property name="js.eslint.eslintPackage" value="" /> <property name="js.eslint.eslintPackage" value="" />
<property name="js-jscs-nodeInterpreter" value="C:\Program Files (x86)\nodejs\node.exe" /> <property name="js-jscs-nodeInterpreter" value="C:\Program Files (x86)\nodejs\node.exe" />
</component> </component>
<component name="RunManager" selected="Dart Test.All Tests"> <component name="RunManager" selected="Dart Test.Controller Tests">
<configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"> <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
<method /> <method />
</configuration> </configuration>
@ -360,6 +384,7 @@
<workItem from="1481377809918" duration="1319000" /> <workItem from="1481377809918" duration="1319000" />
<workItem from="1481389675241" duration="158000" /> <workItem from="1481389675241" duration="158000" />
<workItem from="1481390924053" duration="19000" /> <workItem from="1481390924053" duration="19000" />
<workItem from="1483149948840" duration="913000" />
</task> </task>
<task id="LOCAL-00001" summary="Re-designed exception"> <task id="LOCAL-00001" summary="Re-designed exception">
<created>1481237183504</created> <created>1481237183504</created>
@ -389,21 +414,25 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1481389821679</updated> <updated>1481389821679</updated>
</task> </task>
<option name="localTasksCounter" value="5" /> <task id="LOCAL-00005" summary="findExpose">
<created>1483150316137</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1483150316138</updated>
</task>
<option name="localTasksCounter" value="6" />
<servers /> <servers />
</component> </component>
<component name="TestHistory"> <component name="TestHistory">
<history-entry file="All_Tests - 2016.12.10 at 09h 12m 20s.xml"> <history-entry file="Controller_Tests - 2016.12.30 at 21h 15m 45s.xml">
<configuration name="All Tests" configurationId="DartTestRunConfigurationType" /> <configuration name="Controller Tests" configurationId="DartTestRunConfigurationType" />
</history-entry> </history-entry>
<history-entry file="Hooked_Tests - 2016.12.10 at 08h 57m 36s.xml"> <history-entry file="Controller_Tests - 2016.12.30 at 21h 22m 18s.xml">
<configuration name="Hooked Tests" configurationId="DartTestRunConfigurationType" /> <configuration name="Controller Tests" configurationId="DartTestRunConfigurationType" />
</history-entry> </history-entry>
<history-entry file="Hooked_Tests - 2016.12.10 at 08h 58m 05s.xml"> <history-entry file="DI_Tests - 2016.12.30 at 21h 14m 42s.xml">
<configuration name="Hooked Tests" configurationId="DartTestRunConfigurationType" /> <configuration name="DI Tests" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="Hooked_Tests - 2016.12.10 at 09h 00m 40s.xml">
<configuration name="Hooked Tests" configurationId="DartTestRunConfigurationType" />
</history-entry> </history-entry>
<history-entry file="Hooked_Tests - 2016.12.10 at 09h 01m 14s.xml"> <history-entry file="Hooked_Tests - 2016.12.10 at 09h 01m 14s.xml">
<configuration name="Hooked Tests" configurationId="DartTestRunConfigurationType" /> <configuration name="Hooked Tests" configurationId="DartTestRunConfigurationType" />
@ -423,9 +452,12 @@
<history-entry file="Hooked_Tests - 2016.12.10 at 09h 04m 28s.xml"> <history-entry file="Hooked_Tests - 2016.12.10 at 09h 04m 28s.xml">
<configuration name="Hooked Tests" configurationId="DartTestRunConfigurationType" /> <configuration name="Hooked Tests" configurationId="DartTestRunConfigurationType" />
</history-entry> </history-entry>
<history-entry file="Routing_Tests - 2016.12.30 at 21h 11m 10s.xml">
<configuration name="Routing Tests" configurationId="DartTestRunConfigurationType" />
</history-entry>
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="2684000" /> <option name="totallyTimeSpent" value="3597000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@ -437,29 +469,29 @@
</todo-panel> </todo-panel>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="241" y="49" width="1621" height="830" extended-state="0" /> <frame x="324" y="73" width="1486" height="909" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2125" 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.2122867" sideWeight="0.5" order="0" 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.3292683" sideWeight="0.5" order="6" 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.3292683" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Tool Output" 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="Tool Output" 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="Event Log" 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="true" content_ui="tabs" /> <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.33" sideWeight="0.5" order="7" side_tool="true" 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.32843137" sideWeight="0.5" order="7" 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.32802936" sideWeight="0.5" order="7" 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="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="Version Control" 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="Version Control" 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="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32925338" sideWeight="0.5" order="2" 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" /> <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" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32791328" 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.32680538" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" 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="true" content_ui="tabs" /> <window_info id="Favorites" 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="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32791328" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32791328" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" 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="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" 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="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" 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.3292683" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" 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="1" side_tool="false" content_ui="tabs" /> <window_info id="Find" 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="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" 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" /> <window_info id="Ant Build" active="false" anchor="right" 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" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout> </layout>
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -473,13 +505,22 @@
<MESSAGE value="Core done?" /> <MESSAGE value="Core done?" />
<MESSAGE value="Fixed todo" /> <MESSAGE value="Fixed todo" />
<MESSAGE value="Done???" /> <MESSAGE value="Done???" />
<option name="LAST_COMMIT_MESSAGE" value="Done???" /> <MESSAGE value="findExpose" />
<option name="LAST_COMMIT_MESSAGE" value="findExpose" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager /> <breakpoint-manager />
<watches-manager /> <watches-manager />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/lib/src/http/hooked_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/hooked_service.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/hooked_service.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675"> <state relative-caret-position="675">
@ -521,6 +562,7 @@
<caret line="237" column="49" lean-forward="true" selection-start-line="237" selection-start-column="49" selection-end-line="237" selection-end-column="49" /> <caret line="237" column="49" lean-forward="true" selection-start-line="237" selection-start-column="49" selection-end-line="237" selection-end-column="49" />
<folding> <folding>
<element signature="e#38#58#0" expanded="true" /> <element signature="e#38#58#0" expanded="true" />
<marker date="1483149636000" expanded="true" signature="14571:14573" ph="{...}" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -597,6 +639,7 @@
<caret line="236" column="27" lean-forward="false" selection-start-line="236" selection-start-column="27" selection-end-line="236" selection-end-column="27" /> <caret line="236" column="27" lean-forward="false" selection-start-line="236" selection-start-column="27" selection-end-line="236" selection-end-column="27" />
<folding> <folding>
<element signature="e#38#58#0" expanded="true" /> <element signature="e#38#58#0" expanded="true" />
<marker date="1483149636000" expanded="true" signature="14571:14573" ph="{...}" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -702,72 +745,7 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/controller.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="14" column="23" lean-forward="false" selection-start-line="14" selection-start-column="23" selection-end-line="14" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http_exception.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/hooked_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1275">
<caret line="90" column="29" lean-forward="false" selection-start-line="90" selection-start-column="29" selection-end-line="90" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/routable.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1260">
<caret line="94" column="26" lean-forward="false" selection-start-line="94" selection-start-column="26" selection-end-line="94" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/server_shelved.dart" /> <entry file="file://$PROJECT_DIR$/lib/src/http/server_shelved.dart" />
<entry file="file://$PROJECT_DIR$/lib/src/http/hooked_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675">
<caret line="49" column="5" lean-forward="false" selection-start-line="49" selection-start-column="5" selection-end-line="49" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2175">
<caret line="153" column="25" lean-forward="false" selection-start-line="153" selection-start-column="25" selection-end-line="153" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/common.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="13" column="1" lean-forward="false" selection-start-line="13" selection-start-column="1" selection-end-line="13" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" 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/fatal_error.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/fatal_error.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -775,13 +753,18 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/server.dart"> <entry file="file://$PROJECT_DIR$/test/services_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3555"> <state relative-caret-position="-1374">
<caret line="237" column="49" lean-forward="false" selection-start-line="237" selection-start-column="49" selection-end-line="237" selection-end-column="49" /> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding> </state>
<element signature="e#38#58#0" expanded="true" /> </provider>
</folding> </entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="16" column="16" lean-forward="true" selection-start-line="16" selection-start-column="16" selection-end-line="16" selection-end-column="16" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -796,23 +779,116 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/test/services_test.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/routable.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1374"> <state relative-caret-position="1260">
<caret line="90" column="26" lean-forward="false" selection-start-line="90" selection-start-column="26" selection-end-line="90" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/hooked_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="49" column="5" lean-forward="false" selection-start-line="49" selection-start-column="5" selection-end-line="49" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding> <folding>
<element signature="e#0#47#0" expanded="true" /> <element signature="e#0#17#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml"> <entry file="file://$PROJECT_DIR$/test/common.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15"> <state relative-caret-position="195">
<caret line="1" column="21" lean-forward="false" selection-start-line="1" selection-start-column="21" selection-end-line="1" selection-end-column="21" /> <caret line="13" column="1" lean-forward="false" selection-start-line="13" selection-start-column="1" selection-end-line="13" selection-end-column="1" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/test/di_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#22#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/hooked_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1275">
<caret line="90" column="29" lean-forward="false" selection-start-line="90" selection-start-column="29" selection-end-line="90" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="208" column="26" lean-forward="true" selection-start-line="208" selection-start-column="26" selection-end-line="208" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http_exception.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="474">
<caret line="77" column="0" lean-forward="true" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/memory_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="444">
<caret line="74" column="26" lean-forward="true" selection-start-line="74" selection-start-column="26" selection-end-line="74" selection-end-column="26" />
<folding>
<marker date="1483150602000" expanded="true" signature="331:2888" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="889:1201" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="1605:2124" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="2172:2586" ph="{...}" />
<marker date="1483150602000" expanded="true" signature="2628:2886" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="385">
<caret line="70" column="2" lean-forward="false" selection-start-line="70" selection-start-column="2" selection-end-line="70" selection-end-column="2" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/controller.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315">
<caret line="86" column="35" lean-forward="true" selection-start-line="86" selection-start-column="35" selection-end-line="86" selection-end-column="35" />
<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="175">
<caret line="237" column="42" lean-forward="true" selection-start-line="237" selection-start-column="42" selection-end-line="237" selection-end-column="42" />
<folding>
<element signature="e#38#58#0" expanded="true" />
<marker date="1483149636000" expanded="true" signature="14571:14573" ph="{...}" />
</folding>
</state>
</provider>
</entry>
</component> </component>
</project> </project>

View file

@ -57,26 +57,88 @@ class AngelHttpException implements Exception {
/// Throws a 400 Bad Request error, including an optional arrray of (validation?) /// Throws a 400 Bad Request error, including an optional arrray of (validation?)
/// errors you specify. /// errors you specify.
factory AngelHttpException.badRequest(
{String message: '400 Bad Request', List<String> errors: const []}) =>
new AngelHttpException(null,
message: message, errors: errors, statusCode: 400);
/// Throws a 401 Not Authenticated error.
factory AngelHttpException.notAuthenticated(
{String message: '401 Not Authenticated'}) =>
new AngelHttpException(null, message: message, statusCode: 401);
/// Throws a 402 Payment Required error.
factory AngelHttpException.paymentRequired(
{String message: '402 Payment Required'}) =>
new AngelHttpException(null, message: message, statusCode: 402);
/// Throws a 403 Forbidden error.
factory AngelHttpException.forbidden({String message: '403 Forbidden'}) =>
new AngelHttpException(null, message: message, statusCode: 403);
/// Throws a 404 Not Found error.
factory AngelHttpException.notFound({String message: '404 Not Found'}) =>
new AngelHttpException(null, message: message, statusCode: 404);
/// Throws a 405 Method Not Allowed error.
factory AngelHttpException.methodNotAllowed(
{String message: '405 Method Not Allowed'}) =>
new AngelHttpException(null, message: message, statusCode: 405);
/// Throws a 406 Not Acceptable error.
factory AngelHttpException.notAcceptable(
{String message: '406 Not Acceptable'}) =>
new AngelHttpException(null, message: message, statusCode: 406);
/// Throws a 408 Timeout error.
factory AngelHttpException.methodTimeout({String message: '408 Timeout'}) =>
new AngelHttpException(null, message: message, statusCode: 408);
/// Throws a 409 Conflict error.
factory AngelHttpException.conflict({String message: '409 Conflict'}) =>
new AngelHttpException(null, message: message, statusCode: 409);
/// Throws a 422 Not Processable error.
factory AngelHttpException.notProcessable(
{String message: '422 Not Processable'}) =>
new AngelHttpException(null, message: message, statusCode: 422);
/// Throws a 501 Not Implemented error.
factory AngelHttpException.notImplemented(
{String message: '501 Not Implemented'}) =>
new AngelHttpException(null, message: message, statusCode: 501);
/// Throws a 503 Unavailable error.
factory AngelHttpException.unavailable({String message: '503 Unavailable'}) =>
new AngelHttpException(null, message: message, statusCode: 503);
/// Throws a 400 Bad Request error, including an optional arrray of (validation?)
/// errors you specify.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.BadRequest( factory AngelHttpException.BadRequest(
{String message: '400 Bad Request', List<String> errors: const []}) => {String message: '400 Bad Request', List<String> errors: const []}) =>
new AngelHttpException(null, new AngelHttpException(null,
message: message, errors: errors, statusCode: 400); message: message, errors: errors, statusCode: 400);
/// Throws a 401 Not Authenticated error. /// Throws a 401 Not Authenticated error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.NotAuthenticated( factory AngelHttpException.NotAuthenticated(
{String message: '401 Not Authenticated'}) => {String message: '401 Not Authenticated'}) =>
new AngelHttpException(null, message: message, statusCode: 401); new AngelHttpException(null, message: message, statusCode: 401);
/// Throws a 402 Payment Required error. /// Throws a 402 Payment Required error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.PaymentRequired( factory AngelHttpException.PaymentRequired(
{String message: '402 Payment Required'}) => {String message: '402 Payment Required'}) =>
new AngelHttpException(null, message: message, statusCode: 402); new AngelHttpException(null, message: message, statusCode: 402);
/// Throws a 403 Forbidden error. /// Throws a 403 Forbidden error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.Forbidden({String message: '403 Forbidden'}) => factory AngelHttpException.Forbidden({String message: '403 Forbidden'}) =>
new AngelHttpException(null, message: message, statusCode: 403); new AngelHttpException(null, message: message, statusCode: 403);
/// Throws a 404 Not Found error. /// Throws a 404 Not Found error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.NotFound({String message: '404 Not Found'}) => factory AngelHttpException.NotFound({String message: '404 Not Found'}) =>
new AngelHttpException(null, message: message, statusCode: 404); new AngelHttpException(null, message: message, statusCode: 404);
@ -86,29 +148,35 @@ class AngelHttpException implements Exception {
new AngelHttpException(null, message: message, statusCode: 405); new AngelHttpException(null, message: message, statusCode: 405);
/// Throws a 406 Not Acceptable error. /// Throws a 406 Not Acceptable error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.NotAcceptable( factory AngelHttpException.NotAcceptable(
{String message: '406 Not Acceptable'}) => {String message: '406 Not Acceptable'}) =>
new AngelHttpException(null, message: message, statusCode: 406); new AngelHttpException(null, message: message, statusCode: 406);
/// Throws a 408 Timeout error. /// Throws a 408 Timeout error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.MethodTimeout({String message: '408 Timeout'}) => factory AngelHttpException.MethodTimeout({String message: '408 Timeout'}) =>
new AngelHttpException(null, message: message, statusCode: 408); new AngelHttpException(null, message: message, statusCode: 408);
/// Throws a 409 Conflict error. /// Throws a 409 Conflict error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.Conflict({String message: '409 Conflict'}) => factory AngelHttpException.Conflict({String message: '409 Conflict'}) =>
new AngelHttpException(null, message: message, statusCode: 409); new AngelHttpException(null, message: message, statusCode: 409);
/// Throws a 422 Not Processable error. /// Throws a 422 Not Processable error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.NotProcessable( factory AngelHttpException.NotProcessable(
{String message: '422 Not Processable'}) => {String message: '422 Not Processable'}) =>
new AngelHttpException(null, message: message, statusCode: 422); new AngelHttpException(null, message: message, statusCode: 422);
/// Throws a 501 Not Implemented error. /// Throws a 501 Not Implemented error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.NotImplemented( factory AngelHttpException.NotImplemented(
{String message: '501 Not Implemented'}) => {String message: '501 Not Implemented'}) =>
new AngelHttpException(null, message: message, statusCode: 501); new AngelHttpException(null, message: message, statusCode: 501);
/// Throws a 503 Unavailable error. /// Throws a 503 Unavailable error.
@Deprecated('Use lowercase constructor instead')
factory AngelHttpException.Unavailable({String message: '503 Unavailable'}) => factory AngelHttpException.Unavailable({String message: '503 Unavailable'}) =>
new AngelHttpException(null, message: message, statusCode: 503); new AngelHttpException(null, message: message, statusCode: 503);
} }

View file

@ -90,7 +90,13 @@ class Controller {
return; return;
} }
routable.addRoute(exposeDecl.method, exposeDecl.path, String name = exposeDecl.as?.isNotEmpty == true
? exposeDecl.as
: MirrorSystem.getName(methodName);
routeMappings[name] = routable.addRoute(
exposeDecl.method,
exposeDecl.path,
handleContained(reflectedMethod, preInject(reflectedMethod)), handleContained(reflectedMethod, preInject(reflectedMethod)),
middleware: middleware); middleware: middleware);
} }

View file

@ -36,8 +36,8 @@ class MemoryService<T> extends Service {
MemoryModel found = items[desiredId]; MemoryModel found = items[desiredId];
if (found != null) { if (found != null) {
return _makeJson(desiredId, found); return _makeJson(desiredId, found);
} else throw new AngelHttpException.NotFound(); } else throw new AngelHttpException.notFound();
} else throw new AngelHttpException.NotFound(); } else throw new AngelHttpException.notFound();
} }
Future create(data, [Map params]) async { Future create(data, [Map params]) async {
@ -63,9 +63,9 @@ class MemoryService<T> extends Service {
(data is Map) ? god.deserializeDatum(data, outputType: T) : data; (data is Map) ? god.deserializeDatum(data, outputType: T) : data;
return _makeJson(desiredId, items[desiredId]); return _makeJson(desiredId, items[desiredId]);
} catch (e) { } catch (e) {
throw new AngelHttpException.BadRequest(message: 'Invalid data.'); throw new AngelHttpException.badRequest(message: 'Invalid data.');
} }
} else throw new AngelHttpException.NotFound(); } else throw new AngelHttpException.notFound();
} }
Future update(id, data, [Map params]) async { Future update(id, data, [Map params]) async {
@ -76,9 +76,9 @@ class MemoryService<T> extends Service {
(data is Map) ? god.deserializeDatum(data, outputType: T) : data; (data is Map) ? god.deserializeDatum(data, outputType: T) : data;
return _makeJson(desiredId, items[desiredId]); return _makeJson(desiredId, items[desiredId]);
} catch (e) { } catch (e) {
throw new AngelHttpException.BadRequest(message: 'Invalid data.'); throw new AngelHttpException.badRequest(message: 'Invalid data.');
} }
} else throw new AngelHttpException.NotFound(); } else throw new AngelHttpException.notFound();
} }
Future remove(id, [Map params]) async { Future remove(id, [Map params]) async {
@ -87,6 +87,6 @@ class MemoryService<T> extends Service {
MemoryModel item = items[desiredId]; MemoryModel item = items[desiredId];
items[desiredId] = null; items[desiredId] = null;
return _makeJson(desiredId, item); return _makeJson(desiredId, item);
} else throw new AngelHttpException.NotFound(); } else throw new AngelHttpException.notFound();
} }
} }