-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem: Users may not know how to add context to thinker errors.
Required Changes:
- Add section to README.md about error handling
- Show how to use
errors.Unwrap()with thinker errors - Document all error types in
errors.go - Add example showing error chain inspection
Content to Add:
### Error Handling
The library uses typed errors from `github.com/fogfish/faults`:
```go
// Check error type
if errors.Is(err, thinker.ErrAborted) {
// Handle abortion
}
// Add context
return thinker.ErrLLM.With(err, "failed to process prompt")
// Unwrap error chain
cause := errors.Unwrap(err)Common Errors:
ErrCodec: Encoder/Decoder failedErrLLM: LLM communication failedErrAborted: Agent aborted executionErrMaxEpoch: Maximum iterations reachedErrCmd: Tool/command execution failed
Estimated Effort: 45 minutes
Skills Required: Technical writing, error handling