Constructor for CmpStrError.
Will construct an error with a code, message, optional metadata, and optional cause.
A short, machine-readable error code
The error message (human-readable)
Optionalmeta: CmpStrErrorMetaOptional structured metadata for the error
Optionalcause: unknownOptional cause (native JS Error chaining)
ReadonlycodeA short, machine-readable error code
Optional ReadonlymetaOptional structured metadata for the error
ReadonlywhenTimestamp when the error was created (ISO 8601)
Format the error into a readable string, including code, message, and optional metadata.
Optionalstack: boolean = falseWhether to include the stack trace in the output
Serialize the error into a plain object for JSON output.
Optionalstack: boolean = falseWhether to include the stack trace in the JSON
Pretty string representation of the error.
Base error class for CmpStr.
It provides a standard
codefield and a consistenttoString()/toJSON()output without changing the original error message expectations.