// Exit codes follow docs/TOOLS.md: 2 invalid data or refused, 4 usage or a // missing file. Every refusal in this package is an OrganizationConfigError. // // Rename design r2 (module map): BusinessError is the same constructor under // its old name, so instanceof, exitCode and the message hold for both. The // name property stays "BusinessError": the bus matches refusals by it // (packages/bus/src/broker.mjs) and an uncaught refusal prints it, so the // legacy error output does not change. OrganizationError in organization.mjs // is a different class and stays one. export class OrganizationConfigError extends Error { constructor(message, exitCode = 2) { super(message); this.name = "BusinessError"; this.exitCode = exitCode; } } export const BusinessError = OrganizationConfigError; export function refuse(message, exitCode = 2) { throw new OrganizationConfigError(message, exitCode); }