Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

catch exceptions inside app/Exceptions/Handler.php #188

Open
dmodaii opened this issue Sep 5, 2016 · 0 comments
Open

catch exceptions inside app/Exceptions/Handler.php #188

dmodaii opened this issue Sep 5, 2016 · 0 comments

Comments

@dmodaii
Copy link

dmodaii commented Sep 5, 2016

I can`t catch Bican\Roles\Exceptions\AccessDeniedException in Handler.php

    use Bican\Roles\Exceptions\AccessDeniedException as AccessDeniedException;

    public function render($request, Exception $e)
    {
        die('sww');
        if ($e instanceof AccessDeniedException) {
          echo 'ss';die();
        }
        die('a');
        return parent::render($request, 'ss');
    }

but postman shows:

{
  "message": "You don't have a required ['admin'] role.",
  "status_code": 500,
}

I have registered middeleware in router, How to catch Bican\Roles\Exceptions\AccessDeniedException in Handler.php

@dmodaii dmodaii changed the title catch these exceptions inside app/Exceptions/Handler.php catch exceptions inside app/Exceptions/Handler.php Sep 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant