Wrong exception type caught