-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that an error page is rendered on an undefined function except…
…ion (#34) * Ensure that an error page is rendered on an undefined function exception * Pass reason, remove hard coded 'undef'
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
%% @author Marc Worrell <[email protected]> | ||
%% @copyright 2016-2019 Marc Worrell | ||
%% @copyright 2016-2022 Marc Worrell | ||
%% | ||
%% @doc Cowmachine: webmachine middleware for Cowboy/Zotonic | ||
|
||
%% Copyright 2016-2019 Marc Worrell | ||
%% Copyright 2016-2022 Marc Worrell | ||
%% | ||
%% Licensed under the Apache License, Version 2.0 (the "License"); | ||
%% you may not use this file except in compliance with the License. | ||
|
@@ -115,7 +115,7 @@ request_1(Controller, Req, Env, Options, Context) -> | |
log(#{ at => ?AT, level => error, code => 500, text => "Unexpected exception", | ||
class => Class, reason => Reason, | ||
stack => Stacktrace}, Req), | ||
{stop, cowboy_req:reply(500, Req)} | ||
handle_stop_request(500, Site, {throw, {Reason, Stacktrace}}, Req, Env, State, Context) | ||
end. | ||
|
||
% @todo add the error controller as an application env, if not defined then just terminate with the corresponding error code. | ||
|