{"version":3,"file":"exceptions.cjs","names":[],"sources":["../../src/tabular/exceptions.ts"],"sourcesContent":["/**\n * Errors thrown by the tabular inference module.\n *\n * Each one exists because the underlying failure is unreadable on its own:\n * ONNX Runtime reports a missing operator registration, and the actual cause\n * is an import path chosen three files away.\n *\n * Every subclass sets `name` to a **literal** string rather than to\n * `new.target.name`. Measured in a real build: the minifier renames the\n * class, so the derived form ships as `error.name === \"t\"` — useless in a\n * log and in any consumer that branches on the name.\n */\n\n/** Base class for every error this module throws. */\nexport class TabularError extends Error {\n    constructor(message: string, options?: ErrorOptions) {\n        super(message, options);\n        this.name = \"TabularError\";\n    }\n}\n\n/** The model bytes could not be loaded into a session. */\nexport class ModelLoadError extends TabularError {\n    constructor(message: string, options?: ErrorOptions) {\n        super(message, options);\n        this.name = \"ModelLoadError\";\n    }\n}\n\n/**\n * The runtime has no kernels for this graph's operators.\n *\n * Measured, and the reason this class exists: importing\n * `onnxruntime-web/webgpu` loads a WebAssembly build without the\n * `ai.onnx.ml` domain, so creating a session over any scikit-learn export\n * fails with `No Op registered for TreeEnsembleClassifier`. The message\n * names the fix, because the raw error points at the model instead of at\n * the import.\n */\nexport class UnsupportedGraphError extends TabularError {\n    constructor(message: string, options?: ErrorOptions) {\n        super(message, options);\n        this.name = \"UnsupportedGraphError\";\n    }\n}\n\n/**\n * The bytes are not a compact model, or use a newer layout.\n *\n * Separate from {@link ModelLoadError} because the fix is different: a\n * `.onnx` file handed to the compact reader is a wiring mistake, not a\n * broken model.\n */\nexport class CompactFormatError extends TabularError {\n    constructor(message: string, options?: ErrorOptions) {\n        super(message, options);\n        this.name = \"CompactFormatError\";\n    }\n}\n\n/** The rows do not match what the model expects. */\nexport class FeatureShapeError extends TabularError {\n    constructor(message: string, options?: ErrorOptions) {\n        super(message, options);\n        this.name = \"FeatureShapeError\";\n    }\n}\n\n/** The session ran but its outputs could not be read. */\nexport class InferenceError extends TabularError {\n    constructor(message: string, options?: ErrorOptions) {\n        super(message, options);\n        this.name = \"InferenceError\";\n    }\n}\n\n/**\n * The model bytes could not be fetched or read from the cache.\n *\n * Distinct from {@link ModelLoadError}: this one means the app is offline\n * and nothing was cached, which is a deployment problem, not a model\n * problem.\n */\nexport class ModelFetchError extends TabularError {\n    constructor(message: string, options?: ErrorOptions) {\n        super(message, options);\n        this.name = \"ModelFetchError\";\n    }\n}\n"],"mappings":"AAcA,IAAa,EAAb,cAAkC,KAAM,CACpC,YAAY,EAAiB,EAAwB,CACjD,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,cAChB,CACJ,EAGa,EAAb,cAAoC,CAAa,CAC7C,YAAY,EAAiB,EAAwB,CACjD,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,gBAChB,CACJ,EAYa,EAAb,cAA2C,CAAa,CACpD,YAAY,EAAiB,EAAwB,CACjD,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,uBAChB,CACJ,EASa,EAAb,cAAwC,CAAa,CACjD,YAAY,EAAiB,EAAwB,CACjD,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,oBAChB,CACJ,EAGa,EAAb,cAAuC,CAAa,CAChD,YAAY,EAAiB,EAAwB,CACjD,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,mBAChB,CACJ,EAGa,EAAb,cAAoC,CAAa,CAC7C,YAAY,EAAiB,EAAwB,CACjD,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,gBAChB,CACJ,EASa,EAAb,cAAqC,CAAa,CAC9C,YAAY,EAAiB,EAAwB,CACjD,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,iBAChB,CACJ"}