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

Configure Orval's generated error type #3614

Merged
merged 5 commits into from
Dec 6, 2023
Merged

Conversation

ericpgreen2
Copy link
Contributor

In our custom http client, the fetchWrapper function constructs a specifically-typed error. This PR configures Orval to generate our runtime client with this error type.

Refer to line 31 in Orval's documentation for details on overriding the generated error type.

CC @bcolloran for visibility.

@ericpgreen2 ericpgreen2 self-assigned this Dec 4, 2023
@bcolloran
Copy link
Contributor

Thanks @ericpgreen2! so nice to see that --ignore shrinking day by day! :-D

I approved this fwiw, but I see you tagged @AdityaHegde as the desired reviewer so np if you want to wait for him to verify.

@AdityaHegde
Copy link
Collaborator

Would it be simpler to just update fetchWrapper? error.response.xx feels more cumbersome over error.xx

@ericpgreen2
Copy link
Contributor Author

Would it be simpler to just update fetchWrapper? error.response.xx feels more cumbersome over error.xx

I do think that'd be nicer, just it's a much larger scope change. I'd prefer to push that refactor down-the-line.

@ericpgreen2 ericpgreen2 merged commit 0fbf031 into main Dec 6, 2023
2 checks passed
@ericpgreen2 ericpgreen2 deleted the config-orval-error-type branch December 6, 2023 17:23
esevastyanov pushed a commit that referenced this pull request Dec 8, 2023
* Move error type

* Configure Orval's error type

* Re-generate runtime client

* Remove type cast

* Remove file paths from `svelte-check` ignore

(cherry picked from commit 0fbf031)
mindspank pushed a commit that referenced this pull request Dec 18, 2023
* Move error type

* Configure Orval's error type

* Re-generate runtime client

* Remove type cast

* Remove file paths from `svelte-check` ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants