Skip to content

Commit

Permalink
Merge branch 'hotfix/error-handling' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Dec 20, 2022
2 parents b2ad5f1 + 2a36c13 commit c9d91ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nostr-relay-inspector",
"version": "0.0.12",
"version": "0.0.13",
"description": "js library for inspecting nostr relays",
"main": "index.js",
"type": "module",
Expand Down
7 changes: 4 additions & 3 deletions src/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ Inspector.prototype.getInfoRemote = async function(){
headers = {
"Accept": "application/nostr+json",
}

let res = await fetch(`https://${url.hostname}/`, { method: 'GET', headers: headers})
.then(response => isJson(response) ? response.json().catch() : false )
.catch(err => this.cbcall('error', err)) ;
.then(response => response.json().catch() )
.catch()
// .catch(err => this.cbcall('error', err)) ;

if(this.opts.debug)
console.log(`https://${url.hostname}/`, 'check_nip_11', res)
Expand Down

0 comments on commit c9d91ce

Please sign in to comment.