Skip to content

Commit

Permalink
Add Error property to ErrorHandlerOpts
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeschinkel committed Jan 6, 2025
1 parent 247404b commit d85d44a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oapi_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ type ErrorHandler func(w http.ResponseWriter, message string, statusCode int)
// Passes error-handling specific opts over and above the standard error handler.
type ErrorHandlerWithOpts func(w http.ResponseWriter, message string, statusCode int, opts ErrorHandlerOpts)

// ErrorHandlerArgs is used with ErrorHandlerWithOpts()
// ErrorHandlerOpts is used with ErrorHandlerWithOpts()
type ErrorHandlerOpts struct {
*http.Request
*routers.Route
context.Context
Error error
}

// MultiErrorHandler is called when oapi returns a MultiError type
Expand Down Expand Up @@ -71,6 +72,7 @@ func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) func
Context: r.Context(),
Request: r,
Route: route,
Error: err,
})
return
}
Expand Down

0 comments on commit d85d44a

Please sign in to comment.