Source File
errors.go
Belonging Package
github.com/hirochachacha/go-smb2
package smb2
import (
.
)
// TransportError represents a error come from net.Conn layer.
type TransportError struct {
Err error
}
func ( *TransportError) () string {
return fmt.Sprintf("connection error: %v", .Err)
}
// InternalError represents internal error.
type InternalError struct {
Message string
}
func ( *InternalError) () string {
return fmt.Sprintf("internal error: %s", .Message)
}
// InvalidResponseError represents a data sent by the server is corrupted or unexpected.
type InvalidResponseError struct {
Message string
}
func ( *InvalidResponseError) () string {
return fmt.Sprintf("invalid response error: %s", .Message)
}
// ResponseError represents a error with a nt status code sent by the server.
// The NTSTATUS is defined in [MS-ERREF].
// https://msdn.microsoft.com/en-au/library/cc704588.aspx
type ResponseError struct {
Code uint32 // NTSTATUS
data [][]byte
}
func ( *ResponseError) () string {
return fmt.Sprintf("response error: %v", NtStatus(.Code))
}
// ContextError wraps a context error to support os.IsTimeout function.
type ContextError struct {
Err error
}
func ( *ContextError) () bool {
return .Err == context.DeadlineExceeded
}
func ( *ContextError) () string {
return .Err.Error()
}
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |