Skip to content

file: make ErrTimeout unwrap os.ErrDeadlineExceeded#353

Open
alliasgher wants to merge 1 commit intomicrosoft:mainfrom
alliasgher:fix-errtimeout-unwrap-os-deadline
Open

file: make ErrTimeout unwrap os.ErrDeadlineExceeded#353
alliasgher wants to merge 1 commit intomicrosoft:mainfrom
alliasgher:fix-errtimeout-unwrap-os-deadline

Conversation

@alliasgher
Copy link
Copy Markdown

Fixes #321. Adds Unwrap() error to timeoutError returning os.ErrDeadlineExceeded, so errors.Is(err, os.ErrDeadlineExceeded) works for interoperability with the standard library. Fully backwards-compatible — existing errors.Is(err, ErrTimeout) checks continue to work.

timeoutError.Unwrap returns os.ErrDeadlineExceeded so that callers can
use errors.Is(err, os.ErrDeadlineExceeded) for portability with the
standard library and other packages that check for deadline errors.

The ErrTimeout sentinel value and its Error/Timeout/Temporary methods
are unchanged, so this is fully backwards compatible.

Fixes microsoft#321

Signed-off-by: alliasgher <alliasgher123@gmail.com>
@alliasgher alliasgher requested a review from a team as a code owner April 14, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ErrTimeout should be aliased to os.ErrDeadlineExceeded for OS interop

2 participants