Serializes an error object to a JSON friendly form.
The error.
Optional
Optional serialization options.
Include stack trace in the output (default false)
Serializes an error object to a JSON friendly form.