Skip to content

Commit

Permalink
Wrap application setup in try/catch
Browse files Browse the repository at this point in the history
Fixes issue #46
  • Loading branch information
thekid committed Aug 12, 2018
1 parent 7757e44 commit cfbb1bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Web change log

## 1.4.0 / 2018-08-12

* Fixed issue #46: Uncaught exceptions from application setup in
development mode
(@thekid)
* Merged PR #45: Pass all additional command line arguments to app
environment
(@thekid)
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/xp/web/WebRunner.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private static function error($request, $response, $error, $profile) {
/** @param string[] $args */
public static function main($args) {
$env= new Environment($args[2], $args[0], $args[1], explode('PATH_SEPARATOR', getenv('WEB_CONFIG')), explode('|', getenv('WEB_ARGS')));
$application= (new Source(getenv('WEB_SOURCE'), $env))->application();

$sapi= new SAPI();
$request= new Request($sapi);
Expand All @@ -79,6 +78,7 @@ public static function main($args) {
$response->header('Host', $request->header('Host'));

try {
$application= (new Source(getenv('WEB_SOURCE'), $env))->application();
$application->service($request, $response);
self::log($request, $response);
} catch (Error $e) {
Expand Down

0 comments on commit cfbb1bb

Please sign in to comment.