Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/common/index.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@1.0.3/common/index.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