Skip to content

Fix ActiveJob perform_now return types for rescued errors - #2759

Open
efegokdemir wants to merge 2 commits into
Shopify:mainfrom
efegokdemir:efe/tapioca-active-job-perform-now-exceptions
Open

efegokdemir wants to merge 2 commits into
Shopify:mainfrom
efegokdemir:efe/tapioca-active-job-perform-now-exceptions

Conversation

@efegokdemir

Copy link
Copy Markdown

Motivation

When an ActiveJob rescue handler handles an exception, perform_now returns the exception object. Tapioca currently copies the perform return type, so generated RBIs can omit a value that perform_now returns.

Implementation

Include Exception in the generated return type when rescue handlers are registered. Use T.untyped for void perform signatures, which cannot be combined with another return type.

Tests

Added specs for typed and void perform methods with rescue handlers. Ruby syntax checks and git diff --check passed. The focused spec could not start because the lockfile's paracycle/json_api_client Git dependency is not checked out locally.

Closes #2353

@efegokdemir
efegokdemir requested a review from a team as a code owner November 3, 2026 01:54

This branch has not been deployed

No deployments
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.

Tapioca::Dsl::Compilers::ActiveJob missing Exception as a possible return type in perform_now type compiled signature

1 participant