Skip to content

Commit d306a2d

Browse files
authored
chore: log with %s on unexpected non-sdk err (#20570)
With `%w` it prints an address instead of the error, like `<op> <url> 0xc001329370` instead of `<op> <url>: some error`, honestly idk why you even can log with `%w` it seems like it makes no sense to use `%w` outside of `fmt.Errorf`. This is to help debug coder/internal#1010.
1 parent 30d2fc8 commit d306a2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coderd/coderdtest/coderdtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ func (nopcloser) Close() error { return nil }
16041604
// SDKError coerces err into an SDK error.
16051605
func SDKError(t testing.TB, err error) *codersdk.Error {
16061606
var cerr *codersdk.Error
1607-
require.True(t, errors.As(err, &cerr), "should be SDK error, got %w", err)
1607+
require.True(t, errors.As(err, &cerr), "should be SDK error, got %s", err)
16081608
return cerr
16091609
}
16101610

0 commit comments

Comments
 (0)