Skip to content

Commit

Permalink
Fix Router
Browse files Browse the repository at this point in the history
  • Loading branch information
pierophp committed Nov 12, 2020
1 parent a132393 commit e559c8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add the dependency to `composer.json`, then `composer install`

{
"require": {
"objectiveweb/router": "~2.0"
"beautybrands/router": "~2.0"
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ public function route($request, $callback)
]);
}

static::respond($ex->getMessage(), $ex->getCode());
$code = $ex->getCode();
if ($code < 400 || $code > 599) {
$code = 500;
}

static::respond($ex->getMessage(), $code);
}
}
}
Expand Down

0 comments on commit e559c8d

Please sign in to comment.