# Exceptions

# Naming

Exceptions should extend the PHP \Exception Class and have a Exception suffix.

If an Exception only occurs in one domain, If should be located in the corresponding folder of that domain as well.

# Laravel Exception Handling

Try to use the existing Exception Handling in Laravel (opens new window), by extending the existing Laravel Exceptions.

# Examples

  • \Illuminate\Auth\Access\AuthorizationException will generate a 403 error response
  • \Symfony\Component\HttpKernel\Exception\NotFoundHttpException will generate a 404 error response
  • ...
  • A normal \Exception will result in a 500 error response