Improve error handling

pull/2717/head
Josef Vogt 2020-02-06 16:37:43 +01:00
parent ec9c98df17
commit 24d5564596
1 changed files with 11 additions and 2 deletions

View File

@ -39,7 +39,11 @@ dns_octodns_add() {
addcommand="dns_${element}_add" addcommand="dns_${element}_add"
_debug addcommand "$addcommand" _debug addcommand "$addcommand"
$addcommand "$fulldomain" "$txtvalue" if ! $addcommand "$fulldomain" "$txtvalue"; then
_err "Adding record via $element API was not successful!"
_err "Please check if this API works."
return 1
fi
done done
_info "Finished adding records via octoDNS API" _info "Finished adding records via octoDNS API"
@ -74,7 +78,12 @@ dns_octodns_rm() {
rmcommand="dns_${element}_rm" rmcommand="dns_${element}_rm"
_debug rmcommand "$rmcommand" _debug rmcommand "$rmcommand"
$rmcommand "$fulldomain" "$txtvalue" if ! $rmcommand "$fulldomain" "$txtvalue"; then
_err "Removing record via $element API was not successful!"
_err "You might have to remove the key manually."
_err "Please check if this API works."
return 1
fi
done done
_info "Finished deleting records via octoDNS API" _info "Finished deleting records via octoDNS API"