Skip to content

PURISTA API


PURISTA API / @purista/core / createErrorResponse

Function: createErrorResponse()

createErrorResponse(instanceId, originalEBMessage, statusCode?, error?): Readonly<Omit<CommandErrorResponse, "instanceId">>

Defined in: core/helper/createErrorResponse.impl.ts:25

Creates a error response object based on original command Toggles sender and receiver

Parameters

instanceId

string

The service instance originating the response

originalEBMessage

Readonly<Command>

The command that triggered the error

statusCode?

StatusCode = StatusCode.InternalServerError

Optional HTTP-like status to propagate

error?

unknown

Optional error payload

Returns

Readonly<Omit<CommandErrorResponse, "instanceId">>

CommandErrorResponse message object