You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
cannot use fooHandler (type *handlers.SnsBounceHandler) as type func(http.ResponseWriter, *http.Request) in argument to raven.RecoveryHandler
cannot use raven.RecoveryHandler(snsBh) (type func(http.ResponseWriter, *http.Request)) as type http.Handler in argument to mux.Handle:
func(http.ResponseWriter, *http.Request) does not implement http.Handler (missing ServeHTTP method)
It looks like two things are occurring here:
Custom objects that implement the http.Handler interface are not accepted in the raven.RecoveryHandler function.
One cannot use the raven.RecoverHandler function with mux.Handle because RecoveryHandler returns a function handler instead of a http.Handle object.
The text was updated successfully, but these errors were encountered:
This was the first thing I ran into when integrating raven-go. The library works great, but that usage definitely doesn't match idiomatic go handlers. I've submitted a PR. If you are worried about breaking changes, you could use something like gopkg.in for versioning.
@strife25 it's not the prettiest solution, but you can get pretty close with the existing implementation by using http.HanderFunc:
I suggest wrapping your entire mux, so all handlers get the benefit of reporting. I do something like the following: (handlers.LoggingHandler is from http://www.gorillatoolkit.org/pkg/handlers)
If I create a new HTTP handler like so:
I get the following two exceptions:
It looks like two things are occurring here:
http.Handler
interface are not accepted in theraven.RecoveryHandler
function.raven.RecoverHandler
function withmux.Handle
becauseRecoveryHandler
returns a function handler instead of ahttp.Handle
object.The text was updated successfully, but these errors were encountered: