Skip to content

Chasm engine to convert returned errors#9369

Draft
fretz12 wants to merge 10 commits intotemporalio:mainfrom
fretz12:fredtzeng/chasm-err-convert
Draft

Chasm engine to convert returned errors#9369
fretz12 wants to merge 10 commits intotemporalio:mainfrom
fretz12:fredtzeng/chasm-err-convert

Conversation

@fretz12
Copy link
Contributor

@fretz12 fretz12 commented Feb 20, 2026

What changed?

Changed chasm engine to convert errors, if needed, to the relevant service errors. Chasm errors remain as is. Internal errors (i.e., persistence) are sanitized and error details are preserved via logging. Uncategorized errors are defaulted to serviceerror.Unavailable

Why?

Currently chasm engine can expose non-service errors with internal details. We should not expose this to the API callers as those errors may eventually be exposed publicly. But we do want to preserve the original errors for debugging purposes, and thus they get logged before the conversion.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@fretz12 fretz12 changed the title Chasm engine to convert errors Chasm engine to convert returned errors Feb 20, 2026
@fretz12 fretz12 requested a review from Copilot February 20, 2026 00:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the history service’s CHASM engine error surface by converting non-serviceerror errors (notably persistence-layer errors) into appropriate serviceerror types, while preserving internal details via logging.

Changes:

  • Added a centralized ChasmEngine.convertError to sanitize/translate returned errors (including persistence error mappings and a default-to-Unavailable fallback).
  • Routed multiple CHASM engine call paths through convertError (e.g., StartExecution / UpdateWithStartExecution / component operations).
  • Added unit coverage validating error conversion behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
service/history/chasm_engine.go Adds and wires in error conversion logic across CHASM engine operations to prevent leaking internal/non-service errors.
service/history/chasm_engine_test.go Adds unit tests intended to validate the new error conversion behavior and mappings.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

fretz12 and others added 2 commits February 19, 2026 21:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments