mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
os: add SyscallError.Timeout
Signed-off-by: Roman Volosatovs <roman@profian.com>
This commit is contained in:
committed by
Ron Evans
parent
9e7667ffae
commit
9d73e6cfe4
@@ -70,6 +70,16 @@ func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Err.Error()
|
|||||||
|
|
||||||
func (e *SyscallError) Unwrap() error { return e.Err }
|
func (e *SyscallError) Unwrap() error { return e.Err }
|
||||||
|
|
||||||
|
type timeout interface {
|
||||||
|
Timeout() bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// Timeout reports whether this error represents a timeout.
|
||||||
|
func (e *SyscallError) Timeout() bool {
|
||||||
|
t, ok := e.Err.(timeout)
|
||||||
|
return ok && t.Timeout()
|
||||||
|
}
|
||||||
|
|
||||||
func IsExist(err error) bool {
|
func IsExist(err error) bool {
|
||||||
return underlyingErrorIs(err, ErrExist)
|
return underlyingErrorIs(err, ErrExist)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user