Skip to content

feat(errors): A1 - Result Types & Errors#15

Merged
pipewrk merged 2 commits intomainfrom
sprint-1/a1-errors
Sep 30, 2025
Merged

feat(errors): A1 - Result Types & Errors#15
pipewrk merged 2 commits intomainfrom
sprint-1/a1-errors

Conversation

@pipewrk
Copy link
Contributor

@pipewrk pipewrk commented Sep 30, 2025

Summary

Implements the base error system for WP Kernel with KernelError, TransportError, and ServerError classes.

Changes

  • ✅ Base KernelError class with code, message, data, context
  • ✅ TransportError for HTTP/network errors with retry detection
  • ✅ ServerError for WordPress REST API errors with validation helpers
  • ✅ Full JSON serialization/deserialization support
  • ✅ TypeScript types for all error codes and payloads
  • ✅ Comprehensive unit tests (83 tests, 100% passing)
  • ✅ Exported from @geekist/wp-kernel package

Testing

  • Unit tests pass (pnpm test) - 83 tests
  • Lint passes (pnpm lint)
  • Types check (pnpm typecheck)
  • Build succeeds (pnpm build:packages)

Related

Closes #1 (A1: Result Types & Errors)
Part of Sprint 1 - Resources & Stores

- Add base KernelError class with code, message, data, context
- Add TransportError for HTTP/network errors with retry logic
- Add ServerError for WordPress REST API errors with validation helpers
- Include JSON serialization/deserialization
- Add comprehensive unit tests (83 tests passing)
- Export from @geekist/wp-kernel main entry point

Closes #1
Copilot AI review requested due to automatic review settings September 30, 2025 20:52
@pipewrk pipewrk added sprint-1 Sprint 1 tasks type:enhancement New feature labels Sep 30, 2025
@pipewrk pipewrk self-assigned this Sep 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the foundational error system for WP Kernel, providing structured, serializable error classes that will be used throughout the framework for consistent error handling.

  • Introduces the base KernelError class with standardized error codes, data, and context
  • Adds TransportError for HTTP/network failures with retry detection capabilities
  • Adds ServerError for WordPress REST API errors with validation helpers
  • Includes comprehensive unit tests and JSON serialization/deserialization support

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/create-sprint-1-issues.sh Script for creating GitHub issues for Sprint 1 development tasks
packages/kernel/src/index.ts Exports error types and classes from the kernel package
packages/kernel/src/errors/types.ts TypeScript type definitions for error codes, contexts, and data
packages/kernel/src/errors/index.ts Module exports for the error system
packages/kernel/src/errors/tests/*.test.ts Comprehensive unit tests for all error classes
packages/kernel/src/errors/TransportError.ts HTTP/network error class with retry logic
packages/kernel/src/errors/ServerError.ts WordPress REST API error class with validation parsing
packages/kernel/src/errors/KernelError.ts Base error class with serialization capabilities
BRANCHING_STRATEGY.md Git workflow and branching strategy documentation

- Add Husky for git hooks
- Add lint-staged to format and lint on commit
- Add pre-commit hook with changeset check
- Add changeset for error system implementation (minor bump)

This ensures code quality and prevents CI failures
@pipewrk pipewrk merged commit 8c20b68 into main Sep 30, 2025
7 checks passed
pipewrk added a commit that referenced this pull request Nov 8, 2025
feat(errors): A1 - Result Types & Errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sprint-1 Sprint 1 tasks type:enhancement New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A1: Result Types & Errors

2 participants