Skip to content

Commit

Permalink
Handle console error
Browse files Browse the repository at this point in the history
  • Loading branch information
samaradel committed Dec 15, 2024
1 parent 0530230 commit b97790e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,13 @@ export default {
id: node?.rentContractId,
});
if (state.gracePeriod) {
const err = `You can't deploy on node ${node.nodeId}, its rent contract is in grace period.`;
await new Promise((_, reject) => {
setTimeout(() => {
reject(Error(`You can't deploy on node ${node.nodeId}, its rent contract is in grace period.`));
reject(Error(err));
}, 2000);
});
console.error(err);
}
}
} catch (error) {
Expand Down
4 changes: 3 additions & 1 deletion packages/playground/src/utils/nodeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,13 @@ export async function validateRentContract(
id: node.rentContractId,
});
if (contractInfo.state.gracePeriod) {
const err = `You can't deploy on node ${node.nodeId}, its rent contract is in grace period.`;
await new Promise((_, reject) => {
setTimeout(() => {
reject(Error(`You can't deploy on node ${node.nodeId}, its rent contract is in grace period.`));
reject(Error(err));
}, 2000);
});
console.error(err);
}
}

Expand Down

0 comments on commit b97790e

Please sign in to comment.