mirror of
https://github.com/excalidraw/excalidraw.git
synced 2026-12-06 03:05:18 +03:00
16 lines
459 B
TypeScript
16 lines
459 B
TypeScript
/**
|
|
* Throw from `DiagramToCodePlugin.generate` to fail the generation with
|
|
* a well-known `code` (e.g. "ERR_RATE_LIMIT"), which the plugin's
|
|
* `renderError` can then use to render host-specific UI. Other thrown errors
|
|
* are stored with a generic code.
|
|
*/
|
|
export class DiagramToCodeError extends Error {
|
|
code: string;
|
|
|
|
constructor(message: string, code: string) {
|
|
super(message);
|
|
this.name = "DiagramToCodeError";
|
|
this.code = code;
|
|
}
|
|
}
|