Subjective style point: since you are just checking for an error condition here and raising an exception, you could omit this else block.