-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
When using a custom Exception Mapper for REST client, we need to first
- Try to parse the Response Body with a specific JSon structure to raise a proper exception
- If fails, get the Response Body as String to raise a generic exception with specific message
For that we used :
- response.bufferEntity() to allow reading multiple time
- Then response.readEntity(ErrorMessage.class);
- and finally response.readEntity(String.class)
Up to Quarkus 3.24.3, that seems working.
But when migrating to Quarkus 3.25.0, our tests are failing, saying that the Stream is already closed when trying to read the second time.
Expected behavior
Allow to read the entity multiple time if bufferEntity is called before
Actual behavior
Not allowed to read multiple time
How to Reproduce?
-
Clone this repository : https://github.com/[gcuisinier/quarkus-bug-reproducer
-
Switch to bug-response-entity-cannot-be-read-twice
-
Run
mvn -Dquarkus.platform.version=3.24.3 clean package
This Should works -
run
mvn -Dquarkus.platform.version=3.25.0 clean package
This should failed on QuarkusTest.testStringResponse
QuarkusTest.testStringResponse:35 expected: <UNMANAGED ERROR RETURNING STRING> but was: <Regression : Unable to read entity twice>
Output of uname -a
or ver
No response
Output of java -version
QuarkusTest.testStringResponse:35 expected: but was:
Quarkus version or git rev
3.25.0
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Additional information
No response