refactor(studio-server): oRPC-native typed contract errors — declared .errors() maps, host-context defined-error mapping, client safe()/isDefinedError; delete all error wrappers - #1671
Merged
Conversation
This was referenced Jun 12, 2026
Merged
Owner
Author
This was referenced Jun 12, 2026
Owner
Author
Merge activity
|
mateicanavra
changed the base branch from
design/p7-flat-config-explorer
to
graphite-base/1671
June 12, 2026 23:14
… .errors() maps, host-context defined-error mapping, client safe()/isDefinedError; delete all error wrappers Contract declares per-procedure error maps (packages/studio-server/src/contract/errors.ts) pinning the legacy non-uniform statuses on DECLARED codes (CIV7_*/SETUP_*/SAVED_*, AUTOPLAY_*, RUN_IN_GAME_* incl. 404 server-identity echo, SAVE_DEPLOY_* incl. the documented no-echo 404 asymmetry). Router throws typed errors.CODE(...); the studio host context maps engine RunInGameHttpError statuses to matching raw ORPCErrors that arrive client-side as defined errors. Clients read failures via safe() + isDefinedError() and branch on codes, not raw status numbers. Deleted as architectural dead weight: orpcError/statusToCode/rethrowEngineError (studio-server), orpcFailure/runInGameFailure/saveDeployFailure/readErrorData/StudioServerOrpcFailure/recipeDagSafeErrorMiddleware (studio). RunInGameHttpError-to-contract migration inside the engines (~18 throw sites) is a recorded deferred follow-up. Gates: studio-server build/check/test (5) green; studio tsc clean; studio bun run test 239/50 green; turbo builds 15/15. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mateicanavra
force-pushed
the
design/p7-orpc-native-errors
branch
from
June 12, 2026 23:16
a519209 to
2c100a6
Compare
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.

Contract declares per-procedure error maps (packages/studio-server/src/contract/errors.ts) pinning the legacy non-uniform statuses on DECLARED codes (CIV7_/SETUP_/SAVED_, AUTOPLAY_, RUN_IN_GAME_* incl. 404 server-identity echo, SAVE_DEPLOY_* incl. the documented no-echo 404 asymmetry). Router throws typed errors.CODE(...); the studio host context maps engine RunInGameHttpError statuses to matching raw ORPCErrors that arrive client-side as defined errors. Clients read failures via safe() + isDefinedError() and branch on codes, not raw status numbers.
Deleted as architectural dead weight: orpcError/statusToCode/rethrowEngineError (studio-server), orpcFailure/runInGameFailure/saveDeployFailure/readErrorData/StudioServerOrpcFailure/recipeDagSafeErrorMiddleware (studio). RunInGameHttpError-to-contract migration inside the engines (~18 throw sites) is a recorded deferred follow-up.
Gates: studio-server build/check/test (5) green; studio tsc clean; studio bun run test 239/50 green; turbo builds 15/15.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com