Code Health: Reduce Nesting, Reduce Complexity (original) (raw)

Aren't the following 2 logical checks flipped on the exceptions they should raise?

if not response.GetAuthorizedUser():
•• raise ValueError('wrong encoding')

if response.GetEnc() != 'utf-8':
•• raise AuthError('unauthorized')