errors were being returned instead of raised