mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 17:39:39 +02:00
30 lines
580 B
TypeScript
30 lines
580 B
TypeScript
|
|
/**
|
||
|
|
* Custom error types.
|
||
|
|
*
|
||
|
|
* Python reference: trustgraph-base/trustgraph/exceptions.py
|
||
|
|
*/
|
||
|
|
|
||
|
|
export class TooManyRequestsError extends Error {
|
||
|
|
constructor(message = "Rate limit exceeded") {
|
||
|
|
super(message);
|
||
|
|
this.name = "TooManyRequestsError";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export class LlmError extends Error {
|
||
|
|
constructor(
|
||
|
|
message: string,
|
||
|
|
public readonly errorType: string = "llm-error",
|
||
|
|
) {
|
||
|
|
super(message);
|
||
|
|
this.name = "LlmError";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export class ParseError extends Error {
|
||
|
|
constructor(message: string) {
|
||
|
|
super(message);
|
||
|
|
this.name = "ParseError";
|
||
|
|
}
|
||
|
|
}
|