Skip to content

fix(agent): error instance for validation feedback.#520

Merged
samchon merged 2 commits intomainfrom
feat/error-classes
Jan 11, 2026
Merged

fix(agent): error instance for validation feedback.#520
samchon merged 2 commits intomainfrom
feat/error-classes

Conversation

@samchon
Copy link
Member

@samchon samchon commented Jan 11, 2026

This pull request introduces two new custom error classes, AgenticaValidationError and AgenticaJsonParseError, to improve error handling and reporting in the codebase. These error types are now used in the orchestration logic instead of generic error objects, and are exported for use throughout the package. The changes also update the exports to surface the new error classes from the main module.

Error Handling Improvements:

  • Added new AgenticaValidationError class in AgenticaValidationError.ts to standardize validation error reporting, including detailed error information and a toJSON method for serialization.
  • Added new AgenticaJsonParseError class in AgenticaJsonParseError.ts to handle JSON parsing errors with structured details and a toJSON method.
  • Updated error handling in call.ts to use the new error classes (AgenticaValidationError and AgenticaJsonParseError) instead of plain objects when reporting validation and JSON parse errors. [1] [2] [3]

Exports and Module Organization:

  • Added exports for the new error classes in errors/index.ts and updated the main module exports in index.ts to include the new errors. [1] [2]

@samchon samchon self-assigned this Jan 11, 2026
Copilot AI review requested due to automatic review settings January 11, 2026 16:51
@samchon samchon added this to WrtnLabs Jan 11, 2026
@samchon samchon added the enhancement New feature or request label Jan 11, 2026
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 pull request introduces custom error classes to improve error handling in the agent orchestration logic. The changes replace plain error objects with structured error instances that provide better type safety and serialization capabilities.

Changes:

  • Added two new error classes: AgenticaValidationError and AgenticaJsonParseError with structured error information and JSON serialization support
  • Updated call.ts to use the new error classes instead of plain objects when reporting validation and JSON parsing failures
  • Exported the new error classes from the main module for package-wide use

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/core/src/errors/AgenticaValidationError.ts New error class for validation failures with structured error details
packages/core/src/errors/AgenticaJsonParseError.ts New error class for JSON parsing failures with reason information
packages/core/src/orchestrate/call.ts Updated to instantiate new error classes instead of plain objects
packages/core/src/errors/index.ts Exports the new error classes
packages/core/src/index.ts Re-exports errors from the main module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 11, 2026

Open in StackBlitz

@agentica/benchmark

npm i https://pkg.pr.new/wrtnlabs/agentica/@agentica/benchmark@520

@agentica/chat

npm i https://pkg.pr.new/wrtnlabs/agentica/@agentica/chat@520

agentica

npm i https://pkg.pr.new/wrtnlabs/agentica@520

@agentica/core

npm i https://pkg.pr.new/wrtnlabs/agentica/@agentica/core@520

create-agentica

npm i https://pkg.pr.new/wrtnlabs/agentica/create-agentica@520

@agentica/rpc

npm i https://pkg.pr.new/wrtnlabs/agentica/@agentica/rpc@520

@agentica/vector-selector

npm i https://pkg.pr.new/wrtnlabs/agentica/@agentica/vector-selector@520

commit: c270572

@samchon samchon merged commit ac80587 into main Jan 11, 2026
7 of 12 checks passed
@samchon samchon deleted the feat/error-classes branch January 11, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants