updated console logs and error messages
This commit is contained in:
parent
97dab8fd38
commit
d21ab2e4b0
2 changed files with 2 additions and 4 deletions
|
@ -96,11 +96,10 @@ module.exports = {
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result.length >= 1) {
|
if (result.length >= 1) {
|
||||||
const claimAddress = config.wallet.lbryClaimAddress;
|
const claimAddress = config.wallet.lbryClaimAddress;
|
||||||
// filter out any results that were not published from spee.ch's wallet address
|
// filter out any that were not published from this address
|
||||||
const filteredResult = result.filter((claim) => {
|
const filteredResult = result.filter((claim) => {
|
||||||
return (claim.address === claimAddress);
|
return (claim.address === claimAddress);
|
||||||
});
|
});
|
||||||
// return based on whether any non-spee.ch claims were left
|
|
||||||
if (filteredResult.length >= 1) {
|
if (filteredResult.length >= 1) {
|
||||||
throw new Error('That claim is already in use');
|
throw new Error('That claim is already in use');
|
||||||
};
|
};
|
||||||
|
|
|
@ -349,14 +349,13 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
|
||||||
where: { name, claimId },
|
where: { name, claimId },
|
||||||
})
|
})
|
||||||
.then(claimArray => {
|
.then(claimArray => {
|
||||||
logger.debug('claims found on resolve:', claimArray.length);
|
|
||||||
switch (claimArray.length) {
|
switch (claimArray.length) {
|
||||||
case 0:
|
case 0:
|
||||||
return resolve(null);
|
return resolve(null);
|
||||||
case 1:
|
case 1:
|
||||||
return resolve(prepareClaimData(claimArray[0].dataValues));
|
return resolve(prepareClaimData(claimArray[0].dataValues));
|
||||||
default:
|
default:
|
||||||
logger.error(`more than one entry matches that name (${name}) and claimID (${claimId})`);
|
logger.error(`more than one record matches ${name}#${claimId} in db.Claim`);
|
||||||
return resolve(prepareClaimData(claimArray[0].dataValues));
|
return resolve(prepareClaimData(claimArray[0].dataValues));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue