Skip to content

Commit

Permalink
try/catch json.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Jan 23, 2024
1 parent 337fdf3 commit 7949338
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/trawler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@nostr-fetch/adapter-nostr-tools": "0.13.1",
"@nostrwatch/controlflow": "^0.0.2",
"@nostrwatch/logger": "^0.0.1",
"@nostrwatch/nocap": "^0.1.4",
"@nostrwatch/nocap": "^0.1.5",
"@nostrwatch/nwcache": "^0.0.1",
"@nostrwatch/publisher": "^0.0.1",
"@nostrwatch/seed": "^0.0.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/trawler/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const logger = new Logger('root')
logger.debug('Current Directory', process.cwd())

const $ = daemon()
$.catch(logger.error);
$.catch(logger.err);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nostrwatch/nocap-every-adapter-default",
"version": "1.0.3",
"version": "1.0.4",
"type": "module",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,6 +9,6 @@
"@nostrwatch/nocap-geo-adapter-default": "^1.0.0",
"@nostrwatch/nocap-info-adapter-default": "^1.0.0",
"@nostrwatch/nocap-ssl-adapter-default": "^1.0.1",
"@nostrwatch/nocap-websocket-adapter-default": "^1.0.1"
"@nostrwatch/nocap-websocket-adapter-default": "^1.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class WebsocketAdapterDefault {
const ev = JSON.parse(buffer.toString())
}
catch(e){
this.$.logger.error(`${this.$.url} responded with invalid JSON: ${e}`)
this.$.logger.err(`${this.$.url} responded with invalid JSON: ${e}`)
return this.$.on_error(e)
}
if(ev[0] === 'EVENT') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nostrwatch/nocap-websocket-adapter-default",
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"main": "index.js",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions packages/nocap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nostrwatch/nocap",
"version": "0.1.5",
"version": "0.1.6",
"main": "src/index.js",
"type": "module",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"dependencies": {
"@nostrwatch/logger": "^0.0.1",
"@nostrwatch/nocap-every-adapter-default": "^1.0.2",
"@nostrwatch/nocap-every-adapter-default": "^1.0.4",
"@nostrwatch/utils": "^0.0.1",
"fetch-h2": "3.0.2",
"get-ssl-certificate": "2.3.3",
Expand Down

0 comments on commit 7949338

Please sign in to comment.