Skip to content

feat(exception): offer the upstream status of an engine error to PHP consumers - #40

Merged
schmunk42 merged 3 commits into
masterfrom
feature/flowable-upstream-status
Nov 28, 2026
Merged

schmunk42 merged 3 commits into
masterfrom
feature/flowable-upstream-status

Conversation

@schmunk42

Copy link
Copy Markdown
Member

Summary

FlowableApiException::getUpstreamStatus(): ?int offers PHP consumers the HTTP status the Flowable engine answered with. Since 0.14.0 (#18) that status is no longer part of the message, so a consumer that decides by it (e.g. a fallback when the engine is down) had nothing to read.

  • For every exception built from an engine response it returns the engine's status, unmapped (503 behind a 502, 400 behind a 422, 404 behind a 404).
  • null for a transport error (unreachable()) and for the inherited constructor, so an engine answering 504 can be told from a timeout.
  • PHP only: the status is in no message, HTTP response (with or without debug), header, MCP error or CLI output. The status mapping, the flowable.upstream_error log entry, the audit entries and the signatures of fromUpstreamStatus() and unreachable() are unchanged. No observable behaviour changes.

Tests

  • tests/Exception/FlowableApiExceptionTest.php, tests/Client/FlowableClientErrorTest.php: the status through the factories and through the real client, including transport errors and errors while reading a body. They fail against 0.16.0.
  • tests/Http/UpstreamErrorTest.php: an engine 503 shows in no HTTP response, MCP error, CLI output, health output or audit failure context. The correlation id is replaced before substring checks and the debug trace is left out. Counter-check done locally: with the status written into the message these tests fail.
  • Full suite locally: 2001 tests green.

Release

CHANGELOG block 0.17.0; composer.json requirements unchanged. Tag 0.17.0 follows on the merge commit.

Closes #39

🤖 Generated with Claude Code

schmunk42 and others added 3 commits November 28, 2026 00:33
… getUpstreamStatus() [*]

FlowableApiException keeps the HTTP status the engine answered with,
unmapped, for every exception built from an engine response; a transport
error and the inherited constructor yield null. Messages, headers, the
status mapping and the factory signatures are unchanged.

Part of #39

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rror or CLI output [*]

An engine answering 503 shows in the flowable.upstream_error log entry and
through getUpstreamStatus() only. The correlation id is replaced before
any substring check and the debug trace is left out, so neither can
falsify the result.

Part of #39

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rs section of the README [*]

Part of #39

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@schmunk42 schmunk42 self-assigned this Nov 28, 2026
@schmunk42
schmunk42 merged commit 8f3ae74 into master Nov 28, 2026
2 checks passed
@schmunk42
schmunk42 deleted the feature/flowable-upstream-status branch November 28, 2026 00:38
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.

Offer the upstream HTTP status of an engine error to PHP consumers

1 participant