Skip to content

Commit

Permalink
Add error message for 403 error on API access (#139)
Browse files Browse the repository at this point in the history
Co-authored-by: Franck Nijhof <[email protected]>
  • Loading branch information
davet2001 and frenck authored Oct 22, 2023
1 parent 30897c7 commit 2f86c63
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ function bashio::api.supervisor() {
return "${__BASHIO_EXIT_NOK}"
fi

if [[ "${status}" -eq 403 ]]; then
bashio::log.error "Unable to access the API, forbidden"
return "${__BASHIO_EXIT_NOK}"
fi

if [[ "${status}" -eq 404 ]]; then
bashio::log.error "Requested resource ${resource} was not found"
return "${__BASHIO_EXIT_NOK}"
Expand Down

0 comments on commit 2f86c63

Please sign in to comment.