This repository has been archived by the owner on May 22, 2020. It is now read-only.
Improve channel configuration and error handling #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request closes #7 and closes #8.
The main objective of this PR is to improve the Frankt channel configuration and the error handling.
Improving Frankt channel configuration
The Frankt channel configuration has been moved out of the application environment and now lives into the Frankt channel itself.
Frankt automatically sets up a behaviour on channels that ensures that some callbacks (such as the configuration for the handlers, which are always required) are provided.
At the same time, Frankt also provides a default implementation for optional configurations such as Gettext. This allows Frankt users to configure only what they need and to override default settings when needed.
Take a look at #7 for more information about the reasons for this improvement.
Improve error handling on Frankt channels
Frankt also adds a new configuration for custom error handlers. Frankt handles channel errors gracefully instead of breaking the channel process with uncontrolled exceptions.
As with optional configurations, Frankt automatically provides a default error handler that can be overriden when desired. The default error handler simply logs the exception and pushes an informative message to the channel.
Apart from handling errors in channels. Frankt also provides a
Frankt.ConfigurationError
module, which serves to identify which errors come from wrong Frankt configurations and which ones come from faulty logic in custom action handlers.Take a look at #8 for more information about the reasons for this improvement.
Tasks
This is the detailed list of changes done in this PR.
Documentation is now obsolete, but it will be updated when addressing issue #1 .