Skip to content

feat: expose typed Problem details and original error responses - #141

Merged
matoous merged 3 commits into
mainfrom
md/problem-errors
Oct 26, 2026
Merged

matoous merged 3 commits into
mainfrom
md/problem-errors

Conversation

@matoous

@matoous matoous commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

API exceptions now provide getProblem(): ?Problem, so integrations can read Problem fields without inspecting a mixed response body.

try {
    $checkout = $sumup->checkouts()->get('your-checkout-id');
} catch (\SumUp\Exception\ApiException $error) {
    if (($problem = $error->getProblem()) !== null) {
        echo $problem->type . ': ' . $problem->detail;
    }
}

getResponse() retains the original response for documented and unexpected errors, including its headers and text. Existing body access remains available. Problem details or titles appear in exception messages. Incomplete or malformed Problem bodies remain available as raw data in API errors, and Guzzle connection failures retain their original cause.

The README shows the common error handling path beside SDK usage, with access to the original response for other error details.

Related to sumup/sumup-py#434 and the Python SDK changes in sumup/sumup-py#436.

Expose typed Problem details and preserve error response context. Add focused
regression coverage and concise integration examples.
@matoous matoous self-assigned this Oct 26, 2026
Fall back to the original body for incomplete or invalid Problem data. Avoid array-to-string warnings during hydration and include Problem details or titles in error messages.
Keep existing stringable values working while rejecting malformed error fields. Place the user-facing error handling example beside basic usage.
@matoous
matoous marked this pull request as ready for review October 26, 2026 18:35
@matoous
matoous merged commit 0c03321 into main Oct 26, 2026
11 checks passed
@matoous
matoous deleted the md/problem-errors branch October 26, 2026 18:36
@sumup-release-bot sumup-release-bot Bot mentioned this pull request Oct 26, 2026
matoous pushed a commit that referenced this pull request Oct 26, 2026
Automated sumup-php SDK release
---


## [0.1.8](v0.1.7...v0.1.8)
(2026-10-26)


### Features

* expose typed Problem details and original error responses
([#141](#141))
([0c03321](0c03321))


### Bug Fixes

* use patched PHP runtimes in workflows
([#139](#139))
([65b307e](65b307e))


### Chores

* synced file(s) with sumup/apis
([#135](#135))
([b6878e7](b6878e7))
* synced file(s) with sumup/apis
([#138](#138))
([0ff3d57](0ff3d57))
* update create-github-app-token
([a2879b9](a2879b9))


### Build System & Dependencies

* **deps:** bump actions/create-github-app-token from 3.2.0 to 3.3.0
([#131](#131))
([05f51c6](05f51c6))
* **deps:** bump github.com/pb33f/libopenapi from 0.41.3 to 0.41.6 in
/codegen ([#134](#134))
([984a7aa](984a7aa))
* **deps:** bump reviewdog/action-actionlint from 1.79.1 to 1.80.2
([#132](#132))
([9899268](9899268))
* **deps:** bump reviewdog/action-actionlint from 1.80.2 to 1.80.4
([#140](#140))
([c3c9b10](c3c9b10))
* **deps:** bump shivammathur/setup-php from 2.37.2 to 2.40.0
([#133](#133))
([972c0ba](972c0ba))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: sumup-release-bot[bot] <241716704+sumup-release-bot[bot]@users.noreply.github.com>
@sumup-release-bot sumup-release-bot Bot mentioned this pull request Nov 3, 2026
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