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

Add more properties to errors and export errors. #112

Merged
merged 4 commits into from
Apr 29, 2024
Merged

Conversation

hsubox76
Copy link
Collaborator

Fixes #82

  • Creates a new GoogleGenerativeAIFetchError that extends GoogleGenerativeAIError with additional properties:

    • status - http status code
    • statusText - http status text
    • errorDetails - if the error response contained a json with an error.details field, which may include fields such as type and reason
  • Export all error classes.

@hsubox76 hsubox76 marked this pull request as ready for review April 26, 2024 17:01
@@ -31,3 +40,30 @@ export class GoogleGenerativeAIResponseError<
super(message);
}
}

/**
* Error class covering http errors when calling the server. Includes http
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to capitalize http in our Firebase JS SDK's docs:

See here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@hsubox76 hsubox76 merged commit 111e970 into main Apr 29, 2024
3 checks passed
@hsubox76 hsubox76 deleted the ch-error-handling-2 branch April 29, 2024 18:18
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.

Issue: Improve Error Handling and Provide Detailed Error Messages
3 participants