log error in unexpected case