Skip to main content

foundation-comms.messageorthrow

Home > @genesislcap/foundation-comms > messageOrThrow

messageOrThrow() function

Check if the provided message contains an error and throw an Error if it does

Signature:

messageOrThrow: (message: Message) => Message<any>

Parameters

Parameter

Type

Description

message

Message

Message to check for errors

Returns:

Message<any>

The message if no errors are present, otherwise throws an Error