diff --git a/internal/async_assertion.go b/internal/async_assertion.go index 044acc761..c1e4a9995 100644 --- a/internal/async_assertion.go +++ b/internal/async_assertion.go @@ -357,7 +357,7 @@ func (assertion *AsyncAssertion) match(matcher types.GomegaMatcher, desiredMatch message += format.Object(attachment.Object, 1) } } else { - message = "Error: " + err.Error() + message = "Error: " + err.Error() + "\n" + format.Object(err, 1) } } else { if desiredMatch { diff --git a/internal/async_assertion_test.go b/internal/async_assertion_test.go index 338eb2ae3..82423a725 100644 --- a/internal/async_assertion_test.go +++ b/internal/async_assertion_test.go @@ -1228,10 +1228,19 @@ sprocket: widget: : bob sprocket: - : 17`)) + : 17`)) }) }) + + Context("when a non-PollingSignalError is in play", func() { + It("also includes the format.Object representation", func() { + ig.G.Eventually(func() (int, error) { + return 0, fmt.Errorf("bam") + }).WithTimeout(10 * time.Millisecond).Should(Equal(1)) + Ω(ig.FailureMessage).Should(ContainSubstring("*fmt.wrapError")) + }) + }) }) Describe("The StopTrying signal - when sent by the matcher", func() {