Check error type