errors.sys.mjs (519B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 // @ts-check 5 6 export class UnhandledCaseError extends Error { 7 /** 8 * @param {never} value - Check that 9 * @param {string} typeName - A friendly type name. 10 */ 11 constructor(value, typeName) { 12 super(`There was an unhandled case for "${typeName}": ${value}`); 13 this.name = "UnhandledCaseError"; 14 } 15 }