Assertion: promise's value | /r/CapableOf | experiment with error handling
Facets:
Source sentences:
text: "use strict"; // To experiment with error handling, "threshold" values cause errors randomly const THRESHOLD_A = 8; // can use zero 0 to guarantee error function tetheredGetNumber(resolve, reject) { try { setTimeout( function() { const randomInt = Date.now(); const value = randomInt % 10; try { if(value >= THRESHOLD_A) { throw new Error(`Too large: ${value}`); } } catch(msg) { reject(`Error in callback ${msg}`); } resolve(value); return; }, 500); // To experiment with error at set-up, uncomment the following 'throw'.