Skip to content

Commit 0d0a2f7

Browse files
authored
Add error handling to add-on config API call site (#168)
1 parent 7308cf0 commit 0d0a2f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/addons.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ function bashio::addon.option() {
545545
else
546546
options=$(bashio::jq "${options}" "del(.${key})")
547547
fi
548-
548+
549549
payload=$(bashio::var.json options "^${options}")
550550
bashio::api.supervisor POST "/addons/${slug}/options" "${payload}"
551551

@@ -569,6 +569,10 @@ function bashio::addon.config() {
569569
fi
570570

571571
response=$(bashio::api.supervisor GET "/addons/self/options/config" false)
572+
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
573+
bashio::log.error "Failed to get addon config from Supervisor API"
574+
return "${__BASHIO_EXIT_NOK}"
575+
fi
572576

573577
# If the add-on has no configuration, it returns an empty string.
574578
# This is Bashio logic, that is problematic in this case, so make it a

0 commit comments

Comments
 (0)