Skip to content

Commit

Permalink
docs: Added example of using WithErrorHandler with Server
Browse files Browse the repository at this point in the history
  • Loading branch information
EwenQuim committed Feb 15, 2025
1 parent 9bcef1e commit 2a11ccc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ func ErrorHandler(err error) error {
// engine := fuego.NewEngine(
// WithErrorHandler(HandleHTTPError),
// )
//
// or
//
// server := fuego.NewServer(
// fuego.WithEngineOptions(
// fuego.WithErrorHandler(HandleHTTPError),
// ),
// )
func HandleHTTPError(err error) error {
errResponse := HTTPError{
Err: err,
Expand Down

0 comments on commit 2a11ccc

Please sign in to comment.