Skip to content

fix(rest): separate resource errors from base errors - #1471

Open
efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/fix-discount-code-error-responses
Open

efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/fix-discount-code-error-responses

Conversation

@efegokdemir

Copy link
Copy Markdown

Description

Fixes #1255

Generated DiscountCode resources define an API errors field, which shared the @errors instance variable used by Rest::Base for HTTP error tracking. Keep the base error collection separate so the resource field retains its declared value and failed saves re-raise the original HttpResponseError.

How has this been tested?

  • The regression test failed before the fix with Sorbet TypeError when reading DiscountCode#errors; it passes after the fix.
  • bundle exec ruby -Itest test/rest/base_errors_test.rb — 4 tests passed.
  • API_VERSION=2023_10 bundle exec rake test:rest_wrappers — 642 tests passed.
  • API_VERSION=2026_07 bundle exec rake test:rest_wrappers — 626 tests passed.
  • bundle exec rake test:rest_wrappers — 10,883 tests passed.
  • bundle exec rake test:library — 342 tests passed.
  • bundle exec rubocop — 108 files inspected, no offences.

srb tc could not run because the locked Sorbet binary is x86_64 and cannot execute on this host.

Checklist:

  • My commit message follow the pattern described in here
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the project documentation.
  • I have added a changelog line.

@github-actions github-actions Bot added the devtools-gardener Post the issue or PR to Slack for the gardener label Oct 12, 2026

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

devtools-gardener Post the issue or PR to Slack for the gardener

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DiscountCode REST resource can't handle error responses

1 participant