Is there a way to simulate error messages coming from the REST api?

I recently received the following back from the Confluence Cloud REST API from the Content endpoint, which I hadn’t seen before:

{“statusCode”:500,“message”:“org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only”}

However, the documented responses are only 200, 401, and 404. Based on the message, it looks like the error came from deeper within Confluence rather than the API itself. Anyway, I would like to be able to handle this kind of edge case better but it’s hard to test my code against them.

So is there a way to simulate error response codes?


Have you reported this error as a DEVHELP ticket? I’m wondering if there is an underlying bug here.

Unfortunately not. I haven’t seen it before or since. I don’t know how to replicate and don’t have any other supporting information now either.