EmbedEditorError tells you what failed, by a code.
onLoadError and onProcessError receive one, and processImage and the commands reject with one. Both entries export the class, so instanceof works with either.
Code is the codes it can hold: the editor’s own (EmbedEditorErrorCode) unless said. A command rejects with one of the command’s own codes (EmbedEditorCommandErrorCode) too.
Fields
string[]
The props
INVALID_PROPS names, a nested one by its path (colors.accent, lang.texts.buttonSave), or the paths INVALID_COMMAND names (input.item, or command for a command the handle doesn’t have). Empty for any other code.unknown
The error under it, when there is one. For an
INVALID_COMMAND off the schema, the schema’s own error, with every issue; none for an unknown command name or for an input the command can’t take where the editor stands.string
The same as
code.string
'EmbedEditorError'.Codes
A command has three codes of its own,
EmbedEditorCommandErrorCode:
Where Each One Arrives
An error your own callback throws is not an
EmbedEditorError. It is logged with console.error and never rethrown. If onProcess throws, Save shows it failed and onProcessError isn’t called; output.save then rejects with EXPORT_FAILED, your error as its cause.Example
errors.ts