Documentation ¶
Overview ¶
Error defines all errors that may happen when using the Sandwich Go library. It uses the error codes defined in the protobuf.
Error defines all errors that may happen when using the Sandwich Go library. It uses the error codes defined in the protobuf.
Index ¶
- func NewError(chain *swc.Error) error
- type ALPNError
- type APIError
- type ASN1Error
- type BaseError
- type CertificateError
- type ConfigurationError
- type DataSourceError
- type Error
- type HandshakeError
- type HandshakeStateError
- type IOError
- type KEMError
- type PrivateKeyError
- type ProtobufError
- type RecordPlaneError
- type SocketError
- type SystemError
- type TLSConfigurationError
- type TunnelError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseError ¶
type BaseError struct {
// contains filtered or unexported fields
}
BaseError represents the base structure for all Sandwich errors.
type CertificateError ¶
type CertificateError struct {
BaseError
}
func NewCertificateError ¶
func NewCertificateError(code pb.CertificateError, msg string) *CertificateError
type ConfigurationError ¶
type ConfigurationError struct {
BaseError
}
func NewConfigurationError ¶
func NewConfigurationError(code pb.ConfigurationError, msg string) *ConfigurationError
type DataSourceError ¶
type DataSourceError struct {
BaseError
}
func NewDataSourceError ¶
func NewDataSourceError(code pb.DataSourceError, msg string) *DataSourceError
type Error ¶
type Error interface { // Error extends the builtin `error` interface. error // `Code` returns the error code, defined in the protobuf. Code() int32 // `Unwrap` unwraps the next error. It is meant to be used with the `errors` // package. Unwrap() error // contains filtered or unexported methods }
Error represents the interface for all Sandwich errors.
type HandshakeError ¶
type HandshakeError struct {
BaseError
}
func NewHandshakeError ¶
func NewHandshakeError(code pb.HandshakeError, msg string) *HandshakeError
type HandshakeStateError ¶
type HandshakeStateError struct {
BaseError
}
HandshakeStateError defines errors that take place during the handshake stage. These states are defined by the enum `HandshakeState` in `tunnel.proto`. They are used by `Tunnel.Handshake`.
func NewHandshakeStateError ¶
func NewHandshakeStateError(code int32, msg string) *HandshakeStateError
NewHandshakeStateError creates an error from an error code. The error code is supposed to match a key in `handshakeStateErrorMap`, defined above.
func NewHandshakeStateErrorFromEnum ¶
func NewHandshakeStateErrorFromEnum(err pb.HandshakeState) *HandshakeStateError
NewHandshakeErrorFromEnum creates an error from the enum pb.HandshakeState.
type IOError ¶
type IOError struct {
BaseError
}
IOError defines the error that can happens during the i/o operations done by an I/O interface. These errors are defined by the enum `IOError` in `io.proto`.
func NewIOError ¶
NewIOError creates an error from an error code. The error code is supposed to match a key in `ioErrorMap`, defined above. This function is publicly exposed, as it is meant to be used by the user to implement their own I/O interface.
func NewIOErrorFromEnum ¶
NewIOErrorFromEnum creates an error from the enum pb.IOError.
type PrivateKeyError ¶
type PrivateKeyError struct {
BaseError
}
func NewPrivateKeyError ¶
func NewPrivateKeyError(code pb.PrivateKeyError, msg string) *PrivateKeyError
type ProtobufError ¶
type ProtobufError struct {
BaseError
}
func NewProtobufError ¶
func NewProtobufError(code pb.ProtobufError, msg string) *ProtobufError
type RecordPlaneError ¶
type RecordPlaneError struct {
BaseError
}
RecordPlaneError defines the error that can happens during the record plane. These errors are defined by the enum `RecordError` in `tunnel.proto`. They are used by `Tunnel.Write` and `Tunnel.Read`.
func NewRecordPlaneError ¶
func NewRecordPlaneError(code int32, msg string) *RecordPlaneError
NewRecordPlaneError creates an error from an error code. The error code is supposed to match a key in `recordPlaneErrorMap`, defined above.
func NewRecordPlaneErrorFromEnum ¶
func NewRecordPlaneErrorFromEnum(err pb.RecordError) *RecordPlaneError
NewRecordPlaneErrorFromEnum creates an error from the enum pb.RecordError.
type SocketError ¶
type SocketError struct {
BaseError
}
func NewSocketError ¶
func NewSocketError(code pb.SocketError, msg string) *SocketError
type SystemError ¶
type SystemError struct {
BaseError
}
func NewSystemError ¶
func NewSystemError(code pb.SystemError, msg string) *SystemError
type TLSConfigurationError ¶
type TLSConfigurationError struct {
BaseError
}
func NewTLSConfigurationError ¶
func NewTLSConfigurationError(code pb.TLSConfigurationError, msg string) *TLSConfigurationError
type TunnelError ¶
type TunnelError struct {
BaseError
}
func NewTunnelError ¶
func NewTunnelError(code pb.TunnelError, msg string) *TunnelError