docs: add critical warning about silent error trap to error handling guide#78
Merged
pyramation merged 2 commits intomainfrom Mar 31, 2026
Merged
Conversation
…ing about silent error trap - Rewrite codegen-error-handling.md with correct QueryResult<T> type (data/errors, not value/error) - Add CRITICAL warning about execute() not throwing (silent error swallowing) - Fix result.value → result.data and result.error → result.errors across all reference docs - Fix .execute().unwrap() → .unwrap() (unwrap is a QueryBuilder method, not on result) - Update SKILL.md quick-start to use .unwrap() and add error handling callout - Add correct QueryResult type definition to codegen-orm-output.md
🤖 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:
|
Merged
3 tasks
… and SKILL.md callout - Restored codegen-generate-sdk.md, codegen-orm-output.md, codegen-orm-patterns.md, codegen.md to original - Restored .execute().unwrap() chaining pattern in SKILL.md - Only added critical warning section at top of codegen-error-handling.md - Added error handling callout to SKILL.md Quick Start
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 a prominent "CRITICAL:
execute()Does NOT Throw" warning section to the top ofcodegen-error-handling.mdand a brief callout toSKILL.md. This addresses a recurring issue where AI agents wrap.execute()in baretry/catchblocks, silently swallowing errors because.execute()returns a discriminated union and never throws.Changes (2 files, additive only — no existing content was modified or removed):
codegen-error-handling.md: New section at top with bug example, fix options (.execute().unwrap()and.okcheck), placed before the existing Discriminated Unions sectionSKILL.md: Added error handling callout after Quick Start ORM examples; updated reference table to mark error handling doc as "read first!"Companion PR: constructive#939 adds the same warning to generated ORM
AGENTS.mdfiles viadocs-generator.ts.Review & Testing Checklist for Human
result.valueandresult.error.messageto stay consistent with the rest of the existing doc. Confirm these match the actual runtimeQueryResult<T>type — if the real type usesresult.data/result.errors, both the warning and the rest of the doc need updating together..execute().unwrap()chaining works at runtime: The warning recommends.execute().unwrap()as the primary fix. Verify this pattern actually works —QueryBuilder.execute()returnsPromise<QueryResult<T>>, so.unwrap()must be a method onQueryResult, not just onQueryBuilder.Notes
result.value,result.error.typewith'graphql' | 'network' | 'validation') were intentionally left as-is — any corrections to those should be a separate PR to avoid scope creep.Link to Devin session: https://app.devin.ai/sessions/41ed0f7a17024bf19180f5dcade05b76
Requested by: @pyramation