Log errors when API call is failling #12

Open
opened 2020-06-29 04:11:08 +02:00 by benpro · 1 comment

I just got a

API call FAILED.                                                                                                      
Connection to xxx closed.

But I do not know why, /var/log/evomaintenance.log has no information about it. Was it a 403? Other?
It should be logged.

I just got a ``` API call FAILED. Connection to xxx closed. ``` But I do not know why, `/var/log/evomaintenance.log` has no information about it. Was it a 403? Other? It should be logged.
benpro added the
enhancement
label 2020-06-29 04:11:08 +02:00
Owner

I guess showing the contents of API_RETURN_STATUS is one way to do it?

diff --git a/evomaintenance.sh b/evomaintenance.sh
index 0d1d6ef..bdae38f 100755
--- a/evomaintenance.sh
+++ b/evomaintenance.sh
@@ -315,7 +315,7 @@ hook_api() {
             echo "API call OK."
         else
             echo "API call FAILED."
+            echo "API said: ${API_RETURN_STATUS}"
         fi
     fi
 }
I guess showing the contents of `API_RETURN_STATUS` is one way to do it? ```diff diff --git a/evomaintenance.sh b/evomaintenance.sh index 0d1d6ef..bdae38f 100755 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -315,7 +315,7 @@ hook_api() { echo "API call OK." else echo "API call FAILED." + echo "API said: ${API_RETURN_STATUS}" fi fi } ```
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evomaintenance#12
No description provided.