mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:48:27 +00:00
refactor: unify media understanding pipeline
This commit is contained in:
17
src/media-understanding/errors.ts
Normal file
17
src/media-understanding/errors.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export type MediaUnderstandingSkipReason = "maxBytes" | "timeout" | "unsupported" | "empty";
|
||||
|
||||
export class MediaUnderstandingSkipError extends Error {
|
||||
readonly reason: MediaUnderstandingSkipReason;
|
||||
|
||||
constructor(reason: MediaUnderstandingSkipReason, message: string) {
|
||||
super(message);
|
||||
this.reason = reason;
|
||||
this.name = "MediaUnderstandingSkipError";
|
||||
}
|
||||
}
|
||||
|
||||
export function isMediaUnderstandingSkipError(
|
||||
err: unknown,
|
||||
): err is MediaUnderstandingSkipError {
|
||||
return err instanceof MediaUnderstandingSkipError;
|
||||
}
|
||||
Reference in New Issue
Block a user