fiskaly / fiskaly-sdk-java

fiskaly Cloud-TSE SDK for Java/JRE and Java/Android
MIT License
4 stars 0 forks source link

Exception in ExceptionFactory #3

Closed andreasfreyer closed 4 years ago

andreasfreyer commented 4 years ago

Hello,

ExceptionFactory.java -> buildHttpException(...) Line 28 results in an Exception because decodedBody contains (at least for some Exceptions) plain text and not a JSON string.

Example response: Response{status=400, body='YW1vdW50c19wZXJfcGF5bWVudF90eXBlOiBJbnZhbGlkIHR5cGUuIEV4cGVjdGVkOiBhcnJheSwgZ2l2ZW46IG9iamVjdAo=', headers={X-Request-Id=[0123456789]}}

decodeBody = "amounts_per_payment_type: Invalid type. Expected: array, given: object"

Btw. After Exceptions like this, my JVM crashes as well as mentioned in the issue "#2 Random segmentation faults bug".