Would it be better to raise an exception/return an error immediately in this scenario?