handle some common error cases