-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix: Errors in Create WorkSpace and Create API Key Processes #785
base: main
Are you sure you want to change the base?
Conversation
@anirbanpaulcom is attempting to deploy a commit to the Dub Team on Vercel. A member of the Team first needs to authorize it. |
@steven-tey , @devkiran , Please take a look.Thank you! |
errorResponse.error.message || | ||
errorResponse || | ||
"Something went wrong", | ||
); |
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 curious about when errorResponse
is a string and when it's an object.
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.
What if we do this?
let errorResponse = await res.json();
if (errorResponse.error.message) {
toast.error(errorResponse.error.message);
} else {
errorResponse = await res.text();
toast.error(errorResponse || "Something went wrong");
}
}
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.
@anirbanpaulcom In which case does the API return text vs JSON? Can you clarify?
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 was getting a text error response for Zod's error.
@anirbanpaulcom can you resolve the conflicts? |
@devkiran, Done. |
@anirbanpaulcom there are a bunch of merge conflicts here, can you please resolve them? thank you! |
Fixing:
Screencast.from.16-04-24.12.09.16.PM.IST.webm
Screencast.from.16-04-24.01.11.46.PM.IST.webm