lancet icon indicating copy to clipboard operation
lancet copied to clipboard

Enhancement(retry): Includes the original error of RetryFunc in the return error

Open krau opened this issue 6 months ago • 0 comments

err := retry.Retry(func() error {
		// do something
		return errors.New("some error in retry func")
	})
fmt.Println(err)
// output: function xxx.func1 run failed after 5 times retry;

目前这样的错误信息并不友好, 希望在返回的错误中包含 (最后一次尝试的) 原始的错误信息, 例如:

function xxx.func1 run failed after 5 times retry: some error in retry func

krau avatar Jun 15 '25 15:06 krau