How To

Learn ways to handle errors in BitFrame Microframework

Handle Errors

An exception can simply be handled by putting your code in the try/catch block. You can refer to the API documentation to see the exceptions a method throws. We've designed it so because:

  1. We don't want to tie you down to a default error handler;
  2. Error handling scripts in some instances may be an overkill;
  3. We want to give you freedom to choose whether you want to include an error handler script/add-on/middleware or not;
  4. We want you to be able to choose an error handler that best fits your project's needs.

However, should you need an error handler, we've created a PSR-15 / PSR-7 compatible Whoops Error Handler middleware that you can easily plug into your projects. You can use this middleware to handle errors globally, or locally (i.e. specific to the middleware batches you run).

Comments

Let us know if you have something to say or add