feat: Add more error catching for plugins
All checks were successful
Build Docker / Build Image (push) Successful in 22s
All checks were successful
Build Docker / Build Image (push) Successful in 22s
This means that people could make completely broken plugins and still have a working wallet
This commit is contained in:
parent
a412573fab
commit
a0989cccef
@ -160,11 +160,6 @@ def dns(params,authentication):
|
||||
def niami(params, authentication):
|
||||
domain = params["domain"]
|
||||
response = requests.get(f"https://api.handshake.niami.io/domain/{domain}")
|
||||
print(response.text)
|
||||
if response.status_code != 200:
|
||||
return {"rating":"Error fetching rating from Niami.io"}
|
||||
if response.json()["success"] == False:
|
||||
return {"rating":"Error fetching rating from Niami.io"}
|
||||
data = response.json()["data"]
|
||||
rating = str(data["rating"]["score"]) + " (" + data["rating"]["rarity"] + ")"
|
||||
return {"rating":rating}
|
||||
|
@ -272,6 +272,11 @@ def plugin_output(outputs, returns):
|
||||
html += f'<h4 class="card-title">{returns[returnOutput]["name"]}</h4>'
|
||||
|
||||
# Get the output
|
||||
if returnOutput not in outputs:
|
||||
html += f'<p>No output</p>'
|
||||
html += f'</div>'
|
||||
html += f'</div>'
|
||||
continue
|
||||
output = outputs[returnOutput]
|
||||
if returns[returnOutput]["type"] == "list":
|
||||
html += f'<ul>'
|
||||
|
Loading…
Reference in New Issue
Block a user