From the triage: raise a more specific error; but this looks good otherwise :)