Different Error Handler per Env


#1

I see in the seed example how to bind a custom error handler for secured and unsecured and what not, and I see in the code where I can go all the way down to basically wrap the instance of Silhouette so I can create my own actions and action builders to have my request handlers use my custom error handler on a per request basis.

Is there any other, easier way that I am missing to have different error handlers per Env? Or is there a way in my “CustomSecuredErrorHandler” to inject something to at least know which Env I am using?


#2

so I can create my own actions and action builders to have my request handlers use my custom error handler on a per request basis.

What do you mean with per request basis? Do you mean local error handlers?

Is there any other, easier way that I am missing to have different error handlers per Env? Or is there a way in my “CustomSecuredErrorHandler” to inject something to at least know which Env I am using?

The Silhouette trait is bound per Env. So you could wire it by hand in a Guice provider instead of creating your own implementations. But I think this is something we could improve. Maybe with an error handler provider which allows to bind error handlers per Env and which also provides a global fallback. Would you create an issue?