Raise custom auth error, re-raise on failed re-auth

This commit is contained in:
Râu Cao
2023-06-05 13:52:41 +03:00
parent 82019f47be
commit 8b87072485
3 changed files with 6 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ class Lndhub
data = JSON.parse(res.body)
if data.is_a?(Hash) && data["error"] && data["message"] == "bad auth"
raise "BAD_AUTH"
raise AuthError
else
data
end