Skip to content

Rescue BulkImports::NetworkError on bulk import creation

Carla Drago requested to merge 383781-return-401-on-invalid-request into master

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.

  1. Checkout the branch git checkout 383781-return-401-on-invalid-request
  2. Try creating a bulk import with a curl request:

curl --request POST --header "PRIVATE-TOKEN: INVALID" "http://gdk.test:3000/api/v4/bulk_imports"

  1. 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.

Related to #383781 (closed)

Edited by Carla Drago

Merge request reports

Loading