Skip to main content

namespace ErrBase

undocumented

Classes​

NameDescription
CustomErrorA custom error instance.
ForcedErrorError type that is thrown by Err and the functions returned by ErrBase.msg.

Functions​

msg​

Returns a function that, when called, throws an Err.ForcedError with the given message string.

Definition​

function msg(message: string): () => never;

Parameters​

NameTypeDescription
messagestringthe message to put in the Err.ForcedError instance.
example
const emptyMap = HashMap.empty<number, string>()
emptyMap.get(5, ErrBase.msg('not found'));
// throws: ErrBase.ForcedError(message: 'not found')