In the EngineContext class, we have a number of methods that make requests to the engine for authorizations (and other information). In the case of errors from these request, some methods catch the exception and simply return an empty response to its caller, hiding potential problems with the caller not knowing the difference between a legitimate empty response and something going wrong (the engine being down for example). We saw this in the case of https://jira.camunda.com/browse/OPT-3228, where the cleanup service treated the empty response as there being no authorizations and therefore removing all existing collection roles.
Instead of returning empty collections, we should throw exceptions from these methods in the case of error responses and let the calling classes handle these cases accordingly.
- Error responses from the engine are no longer hidden by the generic catches and return of empty optionals/collections.