UNPKG

simple-in-memory-queue

Version:

A simple in-memory queue, for nodejs and the browser, with consumers for common usecases.

17 lines 793 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnexpectedCodePathError = void 0; /** * UnexpectedCodePath errors are used to indicate that we've reached a code path that should never have been reached * * Purpose of having a dedicated class for this type of error is to allow us to easily add metadata about what was going on when we reached this code path * - e.g., the variables in memory at the time */ class UnexpectedCodePathError extends Error { constructor(message, metadata) { const fullMessage = `UnexpectedCodePath: ${message}${metadata ? `\n\n${JSON.stringify(metadata)}` : ''}}`; super(fullMessage); } } exports.UnexpectedCodePathError = UnexpectedCodePathError; //# sourceMappingURL=UnexpectedCodePathError.js.map