export class VaultError extends Error {
constructor(message: string, public code?: string) {
super(message);
this.name = 'VaultError';
}
}
export class VaultNotFoundError extends VaultError {
constructor(message: string) {
super(message, 'VAULT_NOT_FOUND');
this.name = 'VaultNotFoundError';
}
}
export class InvalidVaultError extends VaultError {
constructor(message: string) {
super(message, 'INVALID_VAULT');
this.name = 'InvalidVaultError';
}
}
export class SecurityError extends VaultError {
constructor(message: string) {
super(message, 'SECURITY_ERROR');
this.name = 'SecurityError';
}
}
export class VaultAccessError extends VaultError {
constructor(message: string, public cause?: any) {
super(message, 'ACCESS_ERROR');
this.name = 'VaultAccessError';
}
}
export class LockTimeoutError extends VaultError {
constructor(message: string) {
super(message, 'LOCK_TIMEOUT');
this.name = 'LockTimeoutError';
}
}
export class FileConflictError extends VaultError {
constructor(message: string) {
super(message, 'FILE_CONFLICT');
this.name = 'FileConflictError';
}
}
export class RateLimitError extends VaultError {
constructor(message: string) {
super(message, 'RATE_LIMIT_EXCEEDED');
this.name = 'RateLimitError';
}
}
export class RestApiError extends VaultError {
constructor(message: string, public statusCode?: number) {
super(message, 'REST_API_ERROR');
this.name = 'RestApiError';
}
}
export class CommandNotAllowedError extends VaultError {
constructor(message: string) {
super(message, 'COMMAND_NOT_ALLOWED');
this.name = 'CommandNotAllowedError';
}
}