Merge pull request #104 from kzys/windows-wsarecv
Log the error's underyling errno if there is
This commit is contained in:
		| @@ -25,6 +25,7 @@ import ( | |||||||
| 	"runtime" | 	"runtime" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"sync" | 	"sync" | ||||||
|  | 	"syscall" | ||||||
| 	"testing" | 	"testing" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| @@ -370,6 +371,13 @@ func TestClientEOF(t *testing.T) { | |||||||
| 	if err := client.Call(ctx, serviceName, "Test", tp, tp); err == nil { | 	if err := client.Call(ctx, serviceName, "Test", tp, tp); err == nil { | ||||||
| 		t.Fatalf("expected error when calling against shutdown server") | 		t.Fatalf("expected error when calling against shutdown server") | ||||||
| 	} else if !errors.Is(err, ErrClosed) { | 	} else if !errors.Is(err, ErrClosed) { | ||||||
|  | 		errno, ok := err.(syscall.Errno) | ||||||
|  | 		if ok { | ||||||
|  | 			t.Logf("errno=%d", errno) | ||||||
|  | 		} else { | ||||||
|  | 			t.Logf("error %q doesn't match syscall.Errno", err) | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		t.Fatalf("expected to have a cause of ErrClosed, got %v", err) | 		t.Fatalf("expected to have a cause of ErrClosed, got %v", err) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Derek McGowan
					Derek McGowan