Rescue BulkImports::NetworkError on bulk import creation
What does this MR do and why?
This change rescues BulkImports::NetworkErrors that result from an invalid token being used when creating bulk imports.
The user will now see a '401 Unauthorized' message rather than a generic '500 Internal Server Error'.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Checkout the branch
git checkout 383781-return-401-on-invalid-request
- Try creating a bulk import with a curl request:
curl --request POST --header "PRIVATE-TOKEN: INVALID" "http://gdk.test:3000/api/v4/bulk_imports"
- observe the
401 Unauthorized
error
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #383781 (closed)
Edited by Carla Drago