Needs to throw an exception in the error block, else will fail silently