[API] Masiv update to api (#1990)
* Masiv refactor of the api * Masiv refactor of the api * Format page.tsx * Format page.tsx * testing * update build.func * Change urls to Repo * Change urls to Repo * update install.func * Add post_to_api_vm * Update api.func * Update api.func * Update api.func * update api.func
This commit is contained in:
committed by
GitHub
parent
0e5f663df5
commit
8129e3cf39
@@ -56,6 +56,7 @@ catch_errors() {
|
||||
|
||||
# This function handles errors
|
||||
error_handler() {
|
||||
source <(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local exit_code="$?"
|
||||
@@ -63,8 +64,11 @@ error_handler() {
|
||||
local command="$2"
|
||||
local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
|
||||
echo -e "\n$error_message"
|
||||
if [[ "$line_number" -eq 23 ]]; then
|
||||
if [[ "$line_number" -eq 44 ]]; then
|
||||
echo -e "The silent function has suppressed the error, run the script with verbose mode enabled, which will provide more detailed output.\n"
|
||||
post_update_to_api "failed" "No error message, script ran in silent mode"
|
||||
else
|
||||
post_update_to_api "failed" "${command}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user