mirror of
https://github.com/morluto/rea.git
synced 2026-11-20 21:53:51 +00:00
fix(windows): report the enforced shortcut parser limit (#12661)
This commit is contained in:
1 parent
484bdc183a
commit
273f048a55
5 files changed
+126
-45
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { ParseFailureError } from "../../domain/parseFailure.js";
|
||||
|
||||
/** Caller-selected budgets that bound Shell Link expansion. */
|
||||
export type WindowsShortcutSelectedBoundary =
|
||||
| "id_list_items"
|
||||
@@ -5,13 +7,22 @@ export type WindowsShortcutSelectedBoundary =
|
||||
| "string_bytes";
|
||||
|
||||
/** Resource boundary exceeded while walking a Shell Link file. */
|
||||
export class WindowsShortcutResourceFailure extends Error {
|
||||
export class WindowsShortcutResourceFailure extends ParseFailureError<"limit"> {
|
||||
declare readonly failure: ParseFailureError<"limit">["failure"] & {
|
||||
readonly limit: { readonly name: WindowsShortcutSelectedBoundary };
|
||||
};
|
||||
|
||||
constructor(
|
||||
readonly boundary: WindowsShortcutSelectedBoundary,
|
||||
readonly maximum: number,
|
||||
message: string,
|
||||
boundary: WindowsShortcutSelectedBoundary,
|
||||
maximum: number,
|
||||
detail: string,
|
||||
) {
|
||||
super(message);
|
||||
super({
|
||||
kind: "limit",
|
||||
format: "windows-shortcut",
|
||||
detail,
|
||||
limit: { name: boundary, maximum },
|
||||
});
|
||||
this.name = "WindowsShortcutResourceFailure";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user