MDL-46195 fix error handling.