-
Couldn't load subscription status.
- Fork 88
fix: Handle parts engine errors gracefully and expose them in Circuit JSON #1574
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
lib/components/base-components/NormalComponent/NormalComponent.ts
Outdated
Show resolved
Hide resolved
lib/components/base-components/NormalComponent/NormalComponent.ts
Outdated
Show resolved
Hide resolved
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.
avoid large try catch blocks, instead, do .catch( on the relevant promise to the parts engine
|
@Ayushjhawar8 i would start from scratch (for the main implementation file) because the diff is really bad- large try catch blocks are a huge problem and not good |
lib/components/base-components/NormalComponent/NormalComponent.ts
Outdated
Show resolved
Hide resolved
| // Check if it's an HTML error page or "Not found" | ||
| if (result.includes("<!DOCTYPE") || result.includes("<html")) { | ||
| throw new Error( | ||
| `Failed to fetch supplier part numbers: Received HTML response instead of JSON. Response starts with: ${result.substring(0, 100)}`, |
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.
VERY NICE HANDLING!!!!!!!!!
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.
NICELY DONE!!!!!
fix #1400
/claim #1400