Engine Refused Error (errors/engine-refused.error.ts)

OpenWA · src/common/errors/engine-refused.error.ts · typescript · MIT
infra, integration, chat, fw:nestjs, tag:errors, tag:exceptions

ForbiddenException subclass thrown when WhatsApp rejects a valid operation, mapping to HTTP 403. Reuse for engine-side refusals like permission or ownership errors.

// Source: https://github.com/rmyndharis/OpenWA | License: MIT | Copyright 2026 Yudhi Armyndharis and OpenWA Contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { ForbiddenException } from '@nestjs/common';

/**
 * Thrown by the engine layer when WhatsApp refuses an otherwise well-formed operation — e.g. editing
 * a message that is not the account's own, a group settings write without admin rights, or a profile
 * change the engine reports as rejected. The request was valid; the refusal happened WhatsApp-side.
 *
 * Extends NestJS `ForbiddenException` so it maps to **HTTP 403** through the built-in exception
 * handler — no custom global filter required. Mirrors {@link CallNotFoundError} (404).
 */
export class EngineRefusedError extends ForbiddenException

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key