-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feature: Added Vercel API error handling #3826
feature: Added Vercel API error handling #3826
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
@NicholasLYang is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm learning Rust, but I don't see anything glaring here!
pub struct CachingStatusResponse { | ||
pub status: CachingStatus, | ||
#[serde(rename_all = "lowercase")] | ||
pub enum CachingStatusResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these _Response
enums feel like they should be Result<CachingStatus, APIError>
. Could write our own version of Response::error_for_status
that checks that status code and if it's an error we deserialize to the APIError
message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure. It's a little frustrating because the field for the valid path isn't a consistent one like { "ok": {...} }
but varies depending on the resource. Hence the redundant enums
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think there's a way we can do this generically? I could make a macro ofc but I don't think that's worth it.
Closed in favor of #3898 |
No description provided.