You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.2 KiB

Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
import { CodeError } from '$libs/errs';
import {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
CONN_ERR_CHANNEL_ALREADY_EXISTS,
CONN_ERR_CHANNEL_NOT_FOUND,
CONN_ERR_CONNECTION_ALREADY_EXISTS,
CONN_ERR_CONNECTION_NOT_FOUND,
CONN_ERR_DISPOSED,
CONN_ERR_INVALID_CONNECTION_NAME,
CONN_ERR_INVALID_FRAME,
CONN_ERR_WEBSOCKET_UNAVAILABLE
} from './consts.ts';
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnDisposedError extends CodeError {
constructor(message: string, options?: { cause?: unknown }) {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
super(CONN_ERR_DISPOSED, { message, cause: options?.cause });
}
}
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnConnectionAlreadyExistsError extends CodeError {
readonly connection: string;
constructor(message: string, connection: string) {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
super(CONN_ERR_CONNECTION_ALREADY_EXISTS, { message });
this.connection = connection;
}
}
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnConnectionNotFoundError extends CodeError {
readonly connection: string;
constructor(message: string, connection: string) {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
super(CONN_ERR_CONNECTION_NOT_FOUND, { message });
this.connection = connection;
}
}
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnInvalidConnectionNameError extends CodeError {
constructor(message: string, options?: { cause?: unknown }) {
super(CONN_ERR_INVALID_CONNECTION_NAME, { message, cause: options?.cause });
}
}
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnInvalidFrameError extends CodeError {
constructor(message: string, options?: { cause?: unknown }) {
super(CONN_ERR_INVALID_FRAME, { message, cause: options?.cause });
}
}
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnChannelAlreadyExistsError extends CodeError {
readonly channel: string;
constructor(message: string, channel: string) {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
super(CONN_ERR_CHANNEL_ALREADY_EXISTS, { message });
this.channel = channel;
}
}
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnChannelNotFoundError extends CodeError {
readonly channel: string;
constructor(message: string, channel: string) {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
super(CONN_ERR_CHANNEL_NOT_FOUND, { message });
this.channel = channel;
}
}
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export class ConnWebSocketUnavailableError extends CodeError {
constructor(message: string, options?: { cause?: unknown }) {
super(CONN_ERR_WEBSOCKET_UNAVAILABLE, { message, cause: options?.cause });
}
}
export function isConnDisposedError(value: unknown): value is ConnDisposedError {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
return value instanceof ConnDisposedError;
}
export function isConnConnectionAlreadyExistsError(
value: unknown
): value is ConnConnectionAlreadyExistsError {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
return value instanceof ConnConnectionAlreadyExistsError;
}
export function isConnConnectionNotFoundError(
value: unknown
): value is ConnConnectionNotFoundError {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
return value instanceof ConnConnectionNotFoundError;
}
export function isConnInvalidConnectionNameError(
value: unknown
): value is ConnInvalidConnectionNameError {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
return value instanceof ConnInvalidConnectionNameError;
}
export function isConnInvalidFrameError(value: unknown): value is ConnInvalidFrameError {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
return value instanceof ConnInvalidFrameError;
}
export function isConnChannelAlreadyExistsError(
value: unknown
): value is ConnChannelAlreadyExistsError {
return value instanceof ConnChannelAlreadyExistsError;
}
export function isConnChannelNotFoundError(
value: unknown
): value is ConnChannelNotFoundError {
return value instanceof ConnChannelNotFoundError;
}
export function isConnWebSocketUnavailableError(
value: unknown
): value is ConnWebSocketUnavailableError {
Migrate buss/conn/sess/perm/cach errors to CodeError Continues phase 4 — sweeps the next batch of modules onto the canonical CodeError base. Same mechanical pattern as sium: - Add `<MOD>_ERR` module seed and `<MOD>_ERR_*` codes via `moduleSeed` + `errCode`. - Convert error classes to `extends CodeError`. Drop the hardcoded `this.name = 'XxxError'` literals — `name` derives from the code. - Drop the `<MOD>_ERROR_NAME_*` constants that only existed to feed those literals. - Type guards keep using `instanceof Class` (works through the CodeError prototype chain). - Subclass-specific fields (envelope, failures, depth, type, key, channel, connection, decision, invariant, etc.) preserved. Modules migrated this commit: - libs/buss (4 classes): BusDisposedError, BusAggregateListenerError, BusReentrancyLimitError, BusInvalidPayloadError - arts/timr (5 classes): TimrDisposedError, TimrInvalidKeyError, TimrDuplicateKeyError, TimrInvalidDelayError, TimrInactiveTimerError (codes live in libs/timers; classes stay in arts/timr) - arts/conn (8 classes): ConnDisposedError, ConnConnectionAlreadyExistsError, ConnConnectionNotFoundError, ConnInvalidConnectionNameError, ConnInvalidFrameError, ConnChannelAlreadyExistsError, ConnChannelNotFoundError, ConnWebSocketUnavailableError. Adds the two missing guards flagged by audit-1-5 section 3.2 (isConnChannelAlreadyExistsError, isConnChannelNotFoundError). - arts/sess (3 classes): SessDisposedError, SessAlreadyCreatedError, SessInvalidSessionError. Sess test updated to assert against the new code-based name. - libs/perm + arts/perm + svrs/perm (3+4+2 classes): PermissionDeniedError, PermissionSchemaError, PermissionRuntimeError, PermInvalidEndpointError, PermNoContextError, PermRemoteRequestError, PermDisposedError (×2), PermInvalidBodyError. Codes live in libs/perm; arts and svrs reach into them. - libs/cach + arts/cach + svrs/cach (3+1+1 classes): CacheKeyError, CacheScopeError, CachePolicyError, CachActiveEntryDisposedError, CachDisposedError. Codes consolidated in libs/cach. Plus audit-1-5 section 3.2 cleanup outside the migration: - libs/auth/errors.ts: adds the 10 missing type guards (isAuthAccountNotLinkedError, isAuthSessionRevokedError, isAuthAssuranceRequiredError, isAuthRateLimitedError, isAuthTenantBoundaryError, isAuthOAuthStateInvalidError, isAuthOAuthProviderError, isAuthOtpInvalidError, isAuthMfaRequiredError, isAuthWebAuthnError). Auth's own `code`/`messageKey` shape is preserved for now — full migration to CodeError needs more thought because of the existing AUTH_ERROR_CODES/AUTH_SAFE_MESSAGES dual structure. Verification: svelte-check 1403 files / 0 errors. Server 1315 tests, client 19 tests — all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
return value instanceof ConnWebSocketUnavailableError;
}

Powered by TurnKey Linux.