updated console logs and error messages

This commit is contained in:
bill bittner 2018-03-07 18:57:35 -08:00
parent 97dab8fd38
commit d21ab2e4b0
2 changed files with 2 additions and 4 deletions

View file

@ -96,11 +96,10 @@ module.exports = {
.then(result => {
if (result.length >= 1) {
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) => {
return (claim.address === claimAddress);
});
// return based on whether any non-spee.ch claims were left
if (filteredResult.length >= 1) {
throw new Error('That claim is already in use');
};

View file

@ -349,14 +349,13 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
where: { name, claimId },
})
.then(claimArray => {
logger.debug('claims found on resolve:', claimArray.length);
switch (claimArray.length) {
case 0:
return resolve(null);
case 1:
return resolve(prepareClaimData(claimArray[0].dataValues));
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));
}
})