using a more proper error class