Fix EZP-21671: add tests for Promise part of the CAPI
Custom matcher for error handling.