show the response body when there is an error

This commit is contained in:
Rui Lopes
2026-06-24 07:24:24 +00:00
parent 23365538fd
commit 555503c564
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ popd
# see https://help.sonatype.com/en/apt-repositories.html
apt-get install -y curl
curl \
--fail \
--fail-with-body \
--show-error \
--user 'alice.doe:password' \
--header 'Content-Type: multipart/form-data' \
+1 -1
View File
@@ -13,7 +13,7 @@ mkdir -p tmp/use-npm-repository && cd tmp/use-npm-repository
# install node LTS.
# see https://github.com/nodesource/distributions#debinstall
curl -sL --fail --show-error https://deb.nodesource.com/setup_24.x | bash
curl -sL --fail-with-body --show-error https://deb.nodesource.com/setup_24.x | bash
apt-get install -y nodejs
node --version
npm --version
+2 -2
View File
@@ -14,8 +14,8 @@ apt-get install -y curl
# see https://help.sonatype.com/display/NXRM3/Raw+Repositories+and+Maven+Sites#RawRepositoriesandMavenSites-UploadingFilestoHostedRawRepositories
expected='this is an adhoc package'
echo "$expected" >package-1.0.0.txt
curl --silent --fail --show-error --user 'alice.doe:password' --upload-file package-1.0.0.txt https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt
curl --silent --fail-with-body --show-error --user 'alice.doe:password' --upload-file package-1.0.0.txt https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt
# download.
actual=$(curl --silent --fail --show-error https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt)
actual=$(curl --silent --fail-with-body --show-error https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt)
[ "$actual" = "$expected" ] || (echo 'upload adhoc package test failed' && false)