-
Notifications
You must be signed in to change notification settings - Fork 0
fix(errors): avoid TaggedError extends warnings #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: chore-release-align-package-versions-to-0.1.0
Are you sure you want to change the base?
fix(errors): avoid TaggedError extends warnings #106
Conversation
6a39abd to
9ebfbbb
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile Summary
|
| Filename | Overview |
|---|---|
| packages/contracts/src/errors.ts | Refactored 3 error classes (ValidationError, AssertionError, NotFoundError) to use intermediate base classes instead of extending TaggedError expressions directly |
| packages/daemon/src/errors.ts | Refactored 5 daemon-specific error classes to use base class pattern, avoiding TypeScript warnings while preserving API |
Confidence score: 5/5
- This PR is extremely safe to merge with virtually no risk of production issues
- Score reflects a purely structural TypeScript refactoring that maintains identical runtime behavior and API compatibility while fixing compiler warnings
- No files require special attention as all changes follow the same safe pattern of extracting TaggedError factory calls into typed base classes
Sequence Diagram
sequenceDiagram
participant User
participant Config as "@outfitter/config"
participant FileSystem as "File System"
participant Parser as "Config Parser"
participant Validator as "Schema Validator"
User->>+Config: "loadConfig(appName, schema)"
Config->>+FileSystem: "Search XDG config paths"
FileSystem-->>-Config: "Return first matching config file"
Config->>+FileSystem: "readFileSync(configPath)"
FileSystem-->>-Config: "Raw config content"
Config->>+Parser: "parseConfigFile(content, filename)"
Parser-->>-Config: "Parsed config object"
Config->>+Validator: "schema.safeParse(config)"
Validator-->>-Config: "Validated config"
Config-->>-User: "Result<T, Error>"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, 1 comment
| > = TaggedError("ParseError")<{ | ||
| /** Human-readable error message describing the parse failure */ | ||
| message: string; | ||
| /** Name of the file that failed to parse */ | ||
| filename: string; | ||
| /** Line number where the error occurred (if available) */ | ||
| line?: number; | ||
| /** Column number where the error occurred (if available) */ | ||
| column?: number; | ||
| }>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: redundant type annotation duplicates the exact same properties that are already specified in the TaggedErrorClass type parameter above
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/config/src/index.ts
Line: 68:77
Comment:
**style:** redundant type annotation duplicates the exact same properties that are already specified in the TaggedErrorClass type parameter above
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.2cdecf0 to
d848054
Compare
9ebfbbb to
bf5a55c
Compare
|
Restacked and resubmitted; no additional changes in this PR. |

Summary
TaggedError extendswarnings.Changes
Testing