@graphty/graphty-element / index / GraphtyErrorInit
Interface: GraphtyErrorInit ​
Defined in: graphty-element/src/errors/GraphtyError.ts:43
Everything a GraphtyError is constructed from.
Properties ​
cause? ​
optionalcause?:unknown
Defined in: graphty-element/src/errors/GraphtyError.ts:65
The original failure, when this error wraps one -- a sibling package's error, usually.
code ​
code:
GraphtyErrorCode
Defined in: graphty-element/src/errors/GraphtyError.ts:45
The machine-readable reason. A consumer switches on this and never on the message.
details? ​
optionaldetails?:Readonly<Record<string,unknown>>
Defined in: graphty-element/src/errors/GraphtyError.ts:61
The facts behind the failure: the offending name and the valid ones, the estimate and the cap, the url and the status. Frozen on construction, and structured so an error UI can render it without parsing prose.
message ​
message:
string
Defined in: graphty-element/src/errors/GraphtyError.ts:47
A sentence a person can read. Not part of the contract; it may be reworded any release.
recoverable? ​
optionalrecoverable?:boolean
Defined in: graphty-element/src/errors/GraphtyError.ts:55
Whether the same call could succeed later without the caller changing anything -- a fetch that timed out, a device that was lost. Defaults to false: a malformed call, a missing name and an exceeded cap all stay broken until something changes.
source ​
source:
GraphtyErrorSource
Defined in: graphty-element/src/errors/GraphtyError.ts:49
The area of the element that failed.
target? ​
optionaltarget?:GraphtyErrorTarget
Defined in: graphty-element/src/errors/GraphtyError.ts:63
The run, layer or scope the failure belongs to, when it belongs to one.