SONAR-4412 Improved error handling