Skip to content

Commit

Permalink
fix(try): restore Success#filter failure message
Browse files Browse the repository at this point in the history
Use the same error message as in 0.x.
  • Loading branch information
jklmli committed Jul 5, 2017
1 parent de4cd13 commit 390ac96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/try/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Success<A> implements Try<A> {
return this;
}
else {
return new Failure<A>(new Error('asdf'));
return new Failure<A>(new Error(`Predicate does not hold for ${this.value}`));
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/try/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test('Success#filter', (t: TestContext) => {
);
t.deepEqual(
success.filter((v: string) => v === 'world'),
new Failure<string>(new Error('asdf'))
new Failure<string>(new Error('Predicate does not hold for hello'))
);
});

Expand Down

0 comments on commit 390ac96

Please sign in to comment.