Skip to content

Add structured error handling with error codes#1

Open
mikkel wants to merge 2 commits intomasterfrom
task/449-add-structured-error-handling-with-error-codes
Open

Add structured error handling with error codes#1
mikkel wants to merge 2 commits intomasterfrom
task/449-add-structured-error-handling-with-error-codes

Conversation

@mikkel
Copy link
Copy Markdown

@mikkel mikkel commented Feb 16, 2026

ATS Task #449

The project runner currently uses generic Error objects everywhere. Add a small error code system:

  1. Define error codes as constants at the top of index.js (e.g. ERR_TASK_NOT_FOUND, ERR_CLAIM_FAILED, ERR_CLAUDE_TIMEOUT, ERR_GIT_FAILED, ERR_PR_FAILED)
  2. Create a simple ProjectRunnerError class that extends Error with a code property
  3. Replace the 3-4 most important throw/catch sites to use these typed errors
  4. In the failTask calls, include the error code in the failure reason so ATS shows what went wrong
  5. Add a brief section to README.md documenting the error codes

Keep it minimal — this is a small improvement, not a rewrite.


Mode: iterative | Iterations: 2 | Run: 1
Generated by ATS Project Runner v3.0.0

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd8c874375

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

err.code can leak Node/system error codes (ENOENT, etc) instead of
runner's ERR_* constants. Only pass through known runner codes; all
others are normalized to ERR_UNKNOWN.

Fixes Codex review comment on PR #1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Author

@mikkel mikkel left a comment

Choose a reason for hiding this comment

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

@/ml2/nanobot/.pr-review-state/review-body.tmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant