Skip to content
Snippets Groups Projects

abort on http 5xx error

Merged Hahn Axel (hahn) requested to merge 5127-detect-5xx-server-error into master
3 files
+ 45
30
Compare changes
  • Side-by-side
  • Inline

Files

+ 5
0
@@ -16,6 +16,7 @@
@@ -16,6 +16,7 @@
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# ah = axel.hahn@iml.unibe.ch
# ah = axel.hahn@iml.unibe.ch
# 2022-02-16 v0.2 ah add --cfg param
# 2022-02-16 v0.2 ah add --cfg param
 
# 2022-03-04 v0.3 ah abort on http 5xx error
# ======================================================================
# ======================================================================
tmpfile=/tmp/outcurl.tmp
tmpfile=/tmp/outcurl.tmp
@@ -365,6 +366,10 @@ typeset cfg_dryrun=false
@@ -365,6 +366,10 @@ typeset cfg_dryrun=false
if [ ${_paramDryrun} = false ]; then
if [ ${_paramDryrun} = false ]; then
_wd ">>>>> $_paramAction $_paramObj [${_object_name}] >> $_sMethod $_sUrl $_jsondata"
_wd ">>>>> $_paramAction $_paramObj [${_object_name}] >> $_sMethod $_sUrl $_jsondata"
http.makeRequest "$_sMethod" "$_sUrl" "$_jsondata"
http.makeRequest "$_sMethod" "$_sUrl" "$_jsondata"
 
if http.isServerError >/dev/null; then
 
echo "CRITICAL ERROR: Director API request failed with a server error $_sMethod $_sUrl"
 
exit 1
 
fi
if [ $_bShowResponse = true ]; then
if [ $_bShowResponse = true ]; then
http.getResponseHeader
http.getResponseHeader
http.getResponse
http.getResponse
Loading