Skip to main content
Module

x/rimbu/mod.ts>ErrBase.msg

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function ErrBase.msg
import { ErrBase } from "https://deno.land/x/rimbu@0.13.1/mod.ts";
const { msg } = ErrBase;

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

Examples

Example 1

const emptyMap = HashMap.empty<number, string>()
emptyMap.get(5, ErrBase.msg('not found'));
// throws: Err.CustomError(message: 'not found')

Parameters

message: string
  • the message to put in the Err.ForcedError instance.

Returns

() => never