WK-1302 improve error handling