mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-16 05:46:36 +02:00
* fix(media): fail closed on attachment canonicalization * fix(media): clarify attachment skip failures * fix(media): preserve attachment URL fallback * fix(media): preserve getPath URL fallback on blocked local paths * changelog: note media attachment canonicalization fail-closed (#66022) --------- Co-authored-by: Devin Robison <drobison@nvidia.com>
22 lines
564 B
TypeScript
22 lines
564 B
TypeScript
export type MediaUnderstandingSkipReason =
|
|
| "maxBytes"
|
|
| "timeout"
|
|
| "unsupported"
|
|
| "empty"
|
|
| "blocked"
|
|
| "tooSmall";
|
|
|
|
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;
|
|
}
|