mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 05:57:26 +00:00
fixes
This commit is contained in:
@@ -68,6 +68,41 @@ default_vars() {
|
||||
i=$RETRY_NUM
|
||||
}
|
||||
|
||||
__curl_err_handler() {
|
||||
local exit_code="$1"
|
||||
local cmd="${BASH_COMMAND:-unknown}"
|
||||
if ! grep -q 'curl' <<<"$cmd"; then
|
||||
return
|
||||
fi
|
||||
|
||||
case $exit_code in
|
||||
1) msg_error "Unsupported protocol in: $cmd" ;;
|
||||
2) msg_error "Failed curl initialization in: $cmd" ;;
|
||||
3) msg_error "Malformed URL in: $cmd" ;;
|
||||
5) msg_error "Could not resolve proxy in: $cmd" ;;
|
||||
6) msg_error "Could not resolve host in: $cmd" ;;
|
||||
7) msg_error "Failed to connect to host in: $cmd" ;;
|
||||
9) msg_error "Access denied to remote resource in: $cmd" ;;
|
||||
18) msg_error "Partial file transfer detected in: $cmd" ;;
|
||||
22) msg_error "HTTP error response in: $cmd" ;;
|
||||
23) msg_error "Write error during transfer in: $cmd" ;;
|
||||
26) msg_error "Read error from local file in: $cmd" ;;
|
||||
28) msg_error "Operation timed out in: $cmd" ;;
|
||||
35) msg_error "SSL connect error in: $cmd" ;;
|
||||
47) msg_error "Too many redirects in: $cmd" ;;
|
||||
51) msg_error "SSL certificate verification failed in: $cmd" ;;
|
||||
52) msg_error "Empty response from server in: $cmd" ;;
|
||||
55) msg_error "Send error during transfer in: $cmd" ;;
|
||||
56) msg_error "Receive error during transfer in: $cmd" ;;
|
||||
60) msg_error "SSL CA certificate not trusted in: $cmd" ;;
|
||||
67) msg_error "Login denied by server in: $cmd" ;;
|
||||
78) msg_error "Remote file not found (404) in: $cmd" ;;
|
||||
*) msg_error "Unhandled curl error (exit $exit_code) in: $cmd" ;;
|
||||
esac
|
||||
|
||||
exit_script
|
||||
}
|
||||
|
||||
# This function displays an informational message with logging support.
|
||||
declare -A MSG_INFO_SHOWN
|
||||
SPINNER_ACTIVE=0
|
||||
|
||||
Reference in New Issue
Block a user