-
-
Notifications
You must be signed in to change notification settings - Fork 49
About Errors
Chyrp Lite offers functions to handle and report errors. The level of error reporting and the verbosity of output depends on whether debug mode is enabled.
In production mode, errors of level E_NOTICE
and E_USER_NOTICE
will be ignored, meaning that you can use the following code to trigger errors only in debug mode:
trigger_error("Foobar!", E_USER_NOTICE);
The error()
function is the backbone of error handling in Chyrp Lite. It will be called automatically if an error or exception is encountered, but it can also be called directly. Be aware that this will report the error to the visitor on a pretty error page and then end execution immediately, so it’s best avoided for recoverable errors.
For recoverable errors you can use the Flash
class to display a warning to the user. Chyrp Lite generally tries to do this for errors encountered on the visitor-facing blog pages. You’ll see Flash being used a lot in MainController, for example.
In debug mode, a backtrace will be captured and enumerated on the pretty error page displayed by error()
.
In debug mode, failure states will be logged to the file error_log.txt in the install directory.
This is the wiki for Chyrp Lite: An ultra-lightweight blogging engine, written in PHP.
- About Permissions
- Tour of a Theme
- Twig Reference
- Twig Variables
- Object Attributes
- Routes and Controllers
- Making Your First Module
- Debug and Tester Modes
- About Errors
- Introduction to Helpers
- Introduction to Translations
- Introduction to Triggers
- Anatomy of info.php Files
- Anatomy of a Feather
- Anatomy of a Module
- Anatomy of a Theme
- Anatomy of a Post
- Localizing Extensions
- Adding Ajax Functionality
- Working with JavaScript
- Working with Model
- Working with Config