Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to respond Cors errors with a custom error type? #472

Open
rcmgleite opened this issue Oct 1, 2024 · 0 comments
Open

Is it possible to respond Cors errors with a custom error type? #472

rcmgleite opened this issue Oct 1, 2024 · 0 comments
Labels
A-cors Project: actix-cors C-improvement Category: an improvement to existing functionality

Comments

@rcmgleite
Copy link

rcmgleite commented Oct 1, 2024

Your issue may already be reported! Please search on the actix-extras issue tracker before creating one.

Expected Behavior

I'm looking for a way to use my own custom error struct for every api call. This means that even when responding to Cors errors, I wanted to be able to use my custom struct instead of using the provided CorsError
Is there a built in way of doing that?

Current Behavior

All cors errors are returned using the CorsError struct

Possible Solution

I'm not super familiar with actix in general so there might be ways to acomplish this via middlewares?

Thanks in advance.

@rcmgleite rcmgleite changed the title Is it possible to respond Cors errors with a customer error type? Is it possible to respond Cors errors with a custom error type? Oct 1, 2024
@robjtede robjtede added C-improvement Category: an improvement to existing functionality A-cors Project: actix-cors labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cors Project: actix-cors C-improvement Category: an improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants