summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-01 10:37:14 +0200
committerYorhel <git@yorhel.nl>2019-10-01 10:37:17 +0200
commit814f74272a8c1b879689e754aec050c3dccd7c30 (patch)
tree03cf2e00f014a69eba9f3fb21ec23f87597d2a3c
parent48391aac145cf9369f7a3fdd8e26f00fa2b7cbc0 (diff)
Use normal request/response flow for 404 errors
i.e. don't throw an exception if no handlers matched. This way the error_404_handler is called before all the `after` hooks are run, as one would expect. The `error_404_handler` setting is the only one without a big WARNING message in the documentation, so it ought to behave like a normal route.
-rw-r--r--lib/TUWF.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/TUWF.pm b/lib/TUWF.pm
index 651c3be..65ba6ce 100644
--- a/lib/TUWF.pm
+++ b/lib/TUWF.pm
@@ -387,7 +387,7 @@ sub _handle_request {
}
}
- die TUWF::Exception->new(404) if !$han;
+ $self->resNotFound if !$han;
# execute post request handler, if any (no need to bother doing this if the
# handler threw a TUWF::Exception like with the after hooks. The
@@ -457,7 +457,6 @@ sub _handle_error {
utf8 => 400,
json => 400,
controlchar => 400,
- 404 => 404,
method => 405,
maxpost => 413,
}->{$terr} || '500';