Core
createPreflightFault
Builds a fault for a failure that may have happened before any response existed.
@defjs/core · Function
Signature
function createPreflightFault( code: PreflightFaultCode, cause?: unknown, response?: HttpMeta, ): PreflightFault;
When cause is given, its message becomes the fault message; otherwise the
code is the message. The result is a native Error named DefjsFault with
code, plus response when one was given.
Parameters
Prop
Type
code PreflightFaultCodeThe specific failure.
cause? unknownUnderlying value, when there is one; the code becomes the message otherwise.
response? HttpMetaMetadata, only where the transport already had some to report.
Returns
A preflight fault.