TeensyPHP provides with an TeensyPHPException class that you can use to throw errors in your application.
TeensyPHPException
use TeensyPHP\Exceptions\TeensyPHPException; // throw new TeensyPHPException("Error message", 500); TeensyPHPException::throwNotFound(); // 404 TeensyPHPException::throwBadRequest(); // 400 TeensyPHPException::throwUnauthorized(); // 403
By default, when no arguments are provided, the error message is "Internal Server Error" and the status code is 500.
There was an error while loading. Please reload this page.