refactor: centralize 7 scattered error classes into VeryfrontError + slug registry - #247
Merged
Merged
Conversation
30 tasks
7 error classes extend plain Error instead of VeryfrontError and bypass the centralized slug registry. This plan migrates them after the main error codes refactoring (PR #246) is complete. Also documents 5 intentionally local control-flow errors that should remain as-is.
ariskemper
marked this pull request as draft
February 6, 2026 16:00
…slug registry Replace 7 classes that extended plain Error with a centralized error registry pattern using VeryfrontError + unique slugs for identification. Migrated errors: - VeryfrontAPIError → API_CLIENT_ERROR (api-client-error) - ConfigValidationError → CONFIG_VALIDATION_FAILED (config-validation-failed) - SecurityError → SECURITY_VIOLATION (security-violation) - ValidationError → INPUT_VALIDATION_FAILED (input-validation-failed) - TokenStorageError → TOKEN_STORAGE_ERROR (token-storage-error) - CacheInvariantError → CACHE_INVARIANT_VIOLATION (cache-invariant-violation) - FallbackExecutionError → FALLBACK_EXHAUSTED (fallback-exhausted)
ariskemper
force-pushed
the
chore/centralize-scattered-errors
branch
from
February 6, 2026 16:09
bab9105 to
e05f09d
Compare
ariskemper
marked this pull request as ready for review
February 6, 2026 16:11
- Move CACHE_INVARIANT_VIOLATION import to top of cache/paths.ts - Add doc comment to CONFIG_VALIDATION_ERROR to distinguish it from CONFIG_VALIDATION_FAILED (schema-level 422 vs file-level 400)
kojiwakayama
added a commit
that referenced
this pull request
Feb 6, 2026
…nd fix error class imports - Unify isAbsolutePath: enhance platform compat layer's isAbsolute to handle Windows drive letters and UNC paths, re-export from path-utils.ts and security/normalization.ts instead of maintaining separate implementations - Remove legacy runtime-errors.ts and its tests (FileSystemError, NetworkError already migrated to VeryfrontError slug registry in PR #247) - Update init-command.ts, page-loader.ts, and client-hydrator.ts to use VeryfrontError.create() instead of deleted FileSystemError/NetworkError classes - Deduplicate remaining CLI utility imports (formatError, ensureDir) in actions.ts, server-checks.ts, helpers.ts, and integration-generator.ts - Fix pre-existing deno fmt violation in client-hydrator.ts
ariskemper
added a commit
that referenced
this pull request
Feb 9, 2026
…slug registry (#247) * chore: add plan for centralizing scattered error classes 7 error classes extend plain Error instead of VeryfrontError and bypass the centralized slug registry. This plan migrates them after the main error codes refactoring (PR #246) is complete. Also documents 5 intentionally local control-flow errors that should remain as-is. * refactor: centralize 7 scattered error classes into VeryfrontError + slug registry Replace 7 classes that extended plain Error with a centralized error registry pattern using VeryfrontError + unique slugs for identification. Migrated errors: - VeryfrontAPIError → API_CLIENT_ERROR (api-client-error) - ConfigValidationError → CONFIG_VALIDATION_FAILED (config-validation-failed) - SecurityError → SECURITY_VIOLATION (security-violation) - ValidationError → INPUT_VALIDATION_FAILED (input-validation-failed) - TokenStorageError → TOKEN_STORAGE_ERROR (token-storage-error) - CacheInvariantError → CACHE_INVARIANT_VIOLATION (cache-invariant-violation) - FallbackExecutionError → FALLBACK_EXHAUSTED (fallback-exhausted) * style: move import to top of file and add doc comments for clarity - Move CACHE_INVARIANT_VIOLATION import to top of cache/paths.ts - Add doc comment to CONFIG_VALIDATION_ERROR to distinguish it from CONFIG_VALIDATION_FAILED (schema-level 422 vs file-level 400) --------- Co-authored-by: ariskemper <aris.github@gmail.com>
kojiwakayama
added a commit
that referenced
this pull request
Aug 17, 2026
…dbox - teams/confluence template clients: strip HTML tags to a fixed point and decode & last, closing incomplete-multi-character-sanitization and double-escaping findings (alerts #276-#278) - push command: drop the dead pushedSourceDigest initializer — every path that reads it reassigns via computePushedSourceDigest, which revalidates remote content itself (alert #285) - worker-script: remove a null comparison already excluded by the early return at the top of snapshotStructuredData (alert #247) - execution-support test: call throwIfChildRunAborted directly instead of asserting the return value of a void function (alerts #279/#280)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #246. Migrates 7 error classes that bypass the centralized system into the
VeryfrontError+ slug registry pattern.Full plan:
plans/centralize_scattered_errors.mdErrors Centralized (7)
api-client-errorVeryfrontAPIErrorconfig-validation-failedConfigValidationErrorsecurity-violationSecurityErrorinput-validation-failedValidationErrortoken-storage-errorTokenStorageErrorcache-invariant-violationCacheInvariantError(2 classes)fallback-exhaustedFallbackExecutionErrorAPI Changes to
types.tsErrorCreateOptions.status?: number— allows per-request status override (e.g., API client errors vary by response)ErrorCreateOptions.cause?: unknown— supports standard Error chaining (not just RFC 9457 string cause)defineError().create()usesoptions.status ?? definition.statusfor status resolutiontoRFC9457()only serializes string causes; Error objects are omitted from the RFC responseIntentionally Local (5 — not migrating)
SemaphoreTimeoutError,TransformTreeTimeoutError,NotSupportedError,TimeoutError,StreamTimeoutError— internal control-flow errors caught close to throw sites.Tasks
Phase 1: Add definitions to registry
error-registry.tsPhase 2: Migrate each error class
VeryfrontAPIError→api-client-error(14 files)ConfigValidationError→config-validation-failed(1 file)SecurityError→security-violation(2 files)ValidationError→input-validation-failed(19 files)TokenStorageError→token-storage-error(7 files)CacheInvariantError→cache-invariant-violation(6 files)FallbackExecutionError→fallback-exhausted(4 files)Phase 3: Delete old error classes
Phase 4: Verify
extends Errorclasses remain