Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It throws an error when there is an unexpected value in the URL. #680

Open
benfiratkaya opened this issue Aug 30, 2023 · 1 comment
Open

Comments

@benfiratkaya
Copy link

It throws an error when there is an unexpected value in the URL. And try catch not working.

    try {
      SimpleRouter::start();
    } catch (Expception $ex) {
      echo $ex->getMessage(); // NOT WORKING!
    }

URL: /dashboard/accounts/"/
Error:

Fatal error: Uncaught TypeError: Typed property Pecee\SimpleRouter\Route\Route::$parameters must be array, null used in /Users/firatkaya/PhpstormProjects/leaderos-v5-global/apps/dashboard/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Route/RouteResource.php:109 Stack trace: #0 /Users/firatkaya/PhpstormProjects/leaderos-v5-global/apps/dashboard/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php(389): Pecee\SimpleRouter\Route\RouteResource->matchRoute('/dashboard/acco...', Object(Pecee\Http\Request)) #1 /Users/firatkaya/PhpstormProjects/leaderos-v5-global/apps/dashboard/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php(353): Pecee\SimpleRouter\Router->routeRequest() #2 /Users/firatkaya/PhpstormProjects/leaderos-v5-global/apps/dashboard/vendor/pecee/simple-router/src/Pecee/SimpleRouter/SimpleRouter.php(69): Pecee\SimpleRouter\Router->start() #3 /Users/firatkaya/PhpstormProjects/leaderos-v5-global/apps/dashboard/public/index.php(897): Pecee\SimpleRouter\SimpleRouter::start() #4 /Users/firatkaya/Phpsto in /Users/firatkaya/PhpstormProjects/leaderos-v5-global/apps/dashboard/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Route/RouteResource.php on line 109
@ms-afk
Copy link
Contributor

ms-afk commented Sep 29, 2023

The try/catch block is not working because you have mistyped Exception as Expception.
As for the error itself, I don't get that in my app, so it must have something to do with how you have set up your routes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants