refactor(python): report pyc format failures through ParseFailure (#10664)

This commit is contained in:
morluto authored and GitHub committed 2026-11-15 13:45:40 +08:00
1 parent 51e9dc156f
commit b33e5c4867
5 files changed
+39 -65

No files matched your search

+2 -10
View File
@@ -1,15 +1,7 @@
import type { PYTHON_PYC_LIMIT_MAXIMA } from "../domain/python/pythonPyc.js";
/** Distinguish corrupt recognized pycs from magics outside parser coverage. */
export class PythonPycFormatFailure extends Error {
constructor(
readonly kind: "malformed" | "unsupported",
message: string,
) {
super(message);
this.name = "PythonPycFormatFailure";
}
}
/** The ParseFailure format of a standalone CPython pyc. */
export const PYTHON_PYC_FORMAT = "python-pyc";
/** Resource boundary exceeded while walking marshal objects. */
export class PythonPycResourceFailure extends Error {