Files
supabase/packages/ai-commands/src/errors.ts
Ivan Vasilov 4dac01e378 chore: Migrate Clippy to Nextjs API docs (#20903)
* Add a new function to ai-commands package.

* Add a new API route to all three apps.

* Refactor the Command component to use the new URL.

* Resort the imports.
2024-02-12 10:10:52 +01:00

29 lines
598 B
TypeScript

export class ApplicationError extends Error {
constructor(
message: string,
public data: Record<string, any> = {}
) {
super(message)
}
}
export class ContextLengthError extends ApplicationError {
constructor() {
super('LLM context length exceeded')
}
}
export class EmptyResponseError extends ApplicationError {
constructor() {
super('LLM API response succeeded but returned nothing')
}
}
export class EmptySqlError extends ApplicationError {
constructor() {
super('LLM did not generate any SQL')
}
}
export class UserError extends ApplicationError {}