/
alex_ru_math
/
openclaw-censor-gate
Обзор
Документация
Войти
/
alex_ru_math
/
openclaw-censor-gate
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/errors.ts
59 строк
2 KB
AlexRuMath
feat: OpenClaw Censor Gate plugin — security gatekeeper with policy checks, DLP, audit, and LLM classifier
15 июн 2026, 18:05
15 июн 2026, 18:05
fb74772
Код
Авторство
О чём код?
// ============================================================ // OpenClaw Censor Gate Plugin — Custom Errors // ============================================================ /** Base error for the censor gate plugin */ export class CensorGateError extends Error { constructor(message: string) { super(message); this.name = "CensorGateError"; } } /** Thrown when plugin configuration is invalid */ export class ConfigValidationError extends CensorGateError { constructor(message: string) { super(`Invalid plugin configuration: ${message}`); this.name = "ConfigValidationError"; } } /** Thrown when the classifier returns invalid output */ export class ClassifierError extends CensorGateError { constructor(message: string) { super(`Classifier error: ${message}`); this.name = "ClassifierError"; } } /** Thrown when the classifier times out */ export class ClassifierTimeoutError extends ClassifierError { constructor(timeoutMs: number) { super(`Classifier timed out after ${timeoutMs}ms`); this.name = "ClassifierTimeoutError"; } } /** Thrown when schema validation fails */ export class SchemaValidationError extends CensorGateError { constructor(message: string) { super(`Schema validation failed: ${message}`); this.name = "SchemaValidationError"; } } /** Thrown when DLP detects secrets in outbound payload */ export class DlpBlockError extends CensorGateError { constructor(reason: string) { super(`DLP block: ${reason}`); this.name = "DlpBlockError"; } } /** Thrown when audit logging fails */ export class AuditError extends CensorGateError { constructor(message: string) { super(`Audit error: ${message}`); this.name = "AuditError"; } }