From 5c4de0e678ea43b209ca3f3c89b3c85bc3ec05be Mon Sep 17 00:00:00 2001 From: Shangaman Date: Wed, 9 Nov 2022 18:37:23 +0100 Subject: [PATCH] added return error as json (test) --- .env.sample | 2 +- app.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.sample b/.env.sample index b849f6f..6a74aa7 100644 --- a/.env.sample +++ b/.env.sample @@ -1,3 +1,3 @@ -RPC_CREDENTIALS=username:password +RPC_CREDENTIALS=masternode_test:p ALLOWED_RPCS=help,listmasternodes PORT = 3000 diff --git a/app.js b/app.js index d768660..57134f0 100644 --- a/app.js +++ b/app.js @@ -45,7 +45,7 @@ async function makeRpc(name, ...params){ } }catch(error){ if (error.errno === "ECONNREFUSED") { - return { status: 503, response: "PIVX node was not responsive." }; + return { status: 503, response: JSON.stringify({response: "PIVX node was not responsive."})}; } if (error.name === 'AbortError') { return "brequbest was aborted'";