DAR-1184, fix error handling after changes in PHP