Skip to content

Releases: NicoPlyley/hono-error-handler

1.0.0

18 Sep 21:49
Compare
Choose a tag to compare

Add Custom Response Handler

This update introduces a new features to the repository: a custom response handler for error responses. The custom response handler allows for more flexible and customizable error response formatting and handling.

Changes Made

  • Added a new custom response handler to the codebase.
  • Updated the documentation to include information about the custom response handler.

Motivation and Context

The motivation behind this change is to provide users with the ability to define their own error response format and behavior. This enhances the flexibility of error handling within the repository and allows users to tailor error responses to their specific needs.

How to Use the Custom Response Handler

To use the custom response handler, developers can pass a custom response function when setting up the error handler. This function will be responsible for constructing and sending error responses based on the provided error object.

For example, here's how to set up the error handler with a custom response handler:

app.onError(errorHandler(myErrorHandler, (error, c) => {
 return c.json({
   error: error.message, 
 }, 
    error.statusCode,
 )
}));

Documentation Updates

This update includes changes to the repository's documentation to reflect the changes made. The documentation now includes details on how to use the custom response handler and its parameters.

Closing Remarks

This feature enhances the error handling capabilities of the repository and provides users with more control over error responses. I'm open to feedback and further improvements based on the review.

0.0.1

18 Sep 20:36
Compare
Choose a tag to compare
0.0.1 Pre-release
Pre-release
fix: Remove duplicated content in README.md