Merge pull request #3 from shocknet/bug/macaroon_error_fix

Macaroon file bug fixes
This commit is contained in:
Emad-salah 2019-12-01 14:39:57 +01:00 committed by GitHub
commit b010478b16
3 changed files with 10 additions and 3 deletions

View file

@ -14,5 +14,12 @@ module.exports = {
2. Not initializing your wallet before using the ShockAPI 2. Not initializing your wallet before using the ShockAPI
`, `,
CERT_MISSING: () => 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"}
`
}; };

View file

@ -68,7 +68,7 @@ module.exports = async (protoPath, lndHost, lndCertPath, macaroonPath) => {
logger.error(error); logger.error(error);
throw error; throw error;
} else { } else {
const error = errorConstants.MACAROON_PATH(macaroonPath); const error = errorConstants.CERT_AND_MACAROON_MISSING(macaroonPath, lndCertPath);
logger.error(error); logger.error(error);
throw error; throw error;
} }

View file

@ -61,7 +61,7 @@ const server = program => {
lndProto: defaults.lndProto, lndProto: defaults.lndProto,
lndHost, lndHost,
lndCertPath, lndCertPath,
macaroonPath macaroonPath: macaroonExists ? macaroonPath : null
}; };
// init lnd module ================= // init lnd module =================