-
Notifications
You must be signed in to change notification settings - Fork 76
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
Improve error handling #149
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@NickHeiner is attempting to deploy a commit to the FixieAI Team on Vercel. A member of the Team first needs to authorize it. |
packages/ai-jsx/src/lib/error.ts
Outdated
export class AIJSXError extends Error { | ||
constructor( | ||
message: string, | ||
public readonly code: number, |
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.
Is it expected that this is thrown exclusively by code that lives in AI.JSX itself?
packages/ai-jsx/src/lib/error.ts
Outdated
export type ErrorKind = | ||
/** An error that is expected to occur, like a network failure. */ | ||
| 'runtime' | ||
/** An error that's most likely caused by the user. */ | ||
| 'user' | ||
/** An error that's most likely the fault of AI.JSX itself. */ | ||
| 'internal'; |
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 skeptical that this is a useful classification in that I suspect it doesn't add material value in places where it's accurate with high confidence (e.g. OpenAI HTTP errors) and is otherwise likely to be inaccurate/confusing.
This improves our error handling to be more structured + consistent. Now, when an AI.JSX run throws an error, we see this in the console:
Key elements: