diff --git a/constants/errors.js b/constants/errors.js index 85570a53..8491c293 100644 --- a/constants/errors.js +++ b/constants/errors.js @@ -14,5 +14,12 @@ module.exports = { 2. Not initializing your wallet before using the ShockAPI `, CERT_MISSING: () => - "Required LND certificate path missing from application configuration." + "Required LND certificate path missing from application configuration.", + CERT_AND_MACAROON_MISSING: (macaroonPath, lndCertPath) => + ` + You neither specified an LND cert path nor a Macaroon path. Please make sure both files exist in the paths you've specified: + + Macaroon Path: ${macaroonPath ? macaroonPath : "N/A"} + LND Certificates path: ${lndCertPath ? lndCertPath : "N/A"} + ` }; diff --git a/services/lnd/lightning.js b/services/lnd/lightning.js index 1a809d4f..b9ebc316 100644 --- a/services/lnd/lightning.js +++ b/services/lnd/lightning.js @@ -68,7 +68,7 @@ module.exports = async (protoPath, lndHost, lndCertPath, macaroonPath) => { logger.error(error); throw error; } else { - const error = errorConstants.MACAROON_PATH(macaroonPath); + const error = errorConstants.CERT_AND_MACAROON_MISSING(macaroonPath, lndCertPath); logger.error(error); throw error; } diff --git a/src/server.js b/src/server.js index bd2e3dc1..1ebed0e0 100644 --- a/src/server.js +++ b/src/server.js @@ -61,7 +61,7 @@ const server = program => { lndProto: defaults.lndProto, lndHost, lndCertPath, - macaroonPath + macaroonPath: macaroonExists ? macaroonPath : null }; // init lnd module =================