feat: add error handling guidance to generated ORM AGENTS.md#939
Merged
pyramation merged 2 commits intomainfrom Mar 31, 2026
Merged
feat: add error handling guidance to generated ORM AGENTS.md#939pyramation merged 2 commits intomainfrom
pyramation merged 2 commits intomainfrom
Conversation
- Add Error Handling section with CRITICAL warning about silent error trap - Show correct vs incorrect patterns (try/catch with .execute() vs .unwrap()) - Document .unwrap(), .unwrapOr(), .unwrapOrElse() helpers - Update Stack and Conventions sections to mention .unwrap() alongside .execute()
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an Error Handling section to the generated ORM
AGENTS.md(produced bygenerateOrmAgentsDocsindocs-generator.ts). This addresses a recurring issue where AI agents wrap.execute()intry/catchand silently swallow errors, because.execute()returns a discriminated union ({ ok, data, errors }) and never throws.The new section includes:
CRITICALcallout explaining the silent error trap.execute().unwrap(),.execute().unwrapOr(),.execute().unwrapOrElse())Also updates the "Stack" and "Conventions" bullets to mention
.execute().unwrap()alongside.execute().Companion PR: constructive-skills#78 adds a critical warning to the error handling skill doc.
Updates since last revision
.execute().unwrap()chaining pattern (not standalone.unwrap()) per Dan's feedback.execute().unwrap(),.execute().unwrapOr(default),.execute().unwrapOrElse(fn)Review & Testing Checklist for Human
.execute().unwrap()chaining works at runtime: The generated docs now show.execute().unwrap()as the recommended pattern. Confirm thatQueryResult(returned by.execute()) actually has.unwrap(),.unwrapOr(), and.unwrapOrElse()methods — or if these are only onQueryBuilder. Cross-checkquery-builder.tslines 32-104 and theQueryResulttype definition.result.dataandresult.errors— confirm these match the actualQueryResult<T>type shape (vsresult.value/result.errorused elsewhere in skill docs).Notes
AGENTS.mdfiles. Existing generated output will not change until codegen is re-run.table-command-generator.ts) still use.execute()insidetry/catch— that's a separate issue and not addressed here.Link to Devin session: https://app.devin.ai/sessions/41ed0f7a17024bf19180f5dcade05b76
Requested by: @pyramation