We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a1e623 commit ba6a6f5Copy full SHA for ba6a6f5
code/solutions/08_1_retry.js
@@ -1,10 +1,10 @@
1
-function MultiplicatorUnitFailure() {}
+class MultiplicatorUnitFailure extends Error {}
2
3
function primitiveMultiply(a, b) {
4
- if (Math.random() < 0.5) {
+ if (Math.random() < 0.2) {
5
return a * b;
6
} else {
7
- throw new MultiplicatorUnitFailure();
+ throw new MultiplicatorUnitFailure("Klunk");
8
}
9
10
@@ -21,4 +21,3 @@ function reliableMultiply(a, b) {
21
22
console.log(reliableMultiply(8, 8));
23
// → 64
24
-
0 commit comments