Adjusted exceptions to use new handling. We throw before returning undefined.