Open MateSoftware2023 opened 11 months ago
Hi! Yes, it's possible, take a look at #26 (issue) and test of the functionality: https://github.com/DDtKey/protect-endpoints/blob/e86976ff0667f7441a44416c9aa94dee579e7d11/actix-web-grants/tests/proc_macro/different_fn_types.rs#L47-L58
This partly depends on the framework you are using. You can also use error catchers (at least for poem
& rocket
)
thanks. That's the way I'm using it now It would be better to have a global configuration instead of using it everywhere
I think catchers on web-framework level is more suitable for global handling.
However, I think we might introduce something like a custom error-generator(configurable as part of middleware) and use user's defined function in macro without explicit attribute 🤔
hi im new user for this framework i want return cutom type if user no permission, return json format not 403 only , how to do?