handle more kinds of errors