fix Carbon getLastErrors exception check