Throw exception instead of just printing error