Some checks are pending
docker-build-cometbft / vars (push) Waiting to run
docker-build-cometbft / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-cometbft / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-cometbft / merge-images (push) Blocked by required conditions
docker-build-e2e-node / vars (push) Waiting to run
docker-build-e2e-node / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-e2e-node / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-e2e-node / merge-images (push) Blocked by required conditions
35 lines
1 KiB
Go
35 lines
1 KiB
Go
package privval
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
// EndpointTimeoutError occurs when endpoint times out.
|
|
type EndpointTimeoutError struct{}
|
|
|
|
// Implement the net.Error interface.
|
|
func (e EndpointTimeoutError) Error() string { return "endpoint connection timed out" }
|
|
func (e EndpointTimeoutError) Timeout() bool { return true }
|
|
func (e EndpointTimeoutError) Temporary() bool { return true }
|
|
|
|
// Socket errors.
|
|
var (
|
|
ErrConnectionTimeout = EndpointTimeoutError{}
|
|
ErrNoConnection = errors.New("endpoint is not connected")
|
|
ErrReadTimeout = errors.New("endpoint read timed out")
|
|
ErrUnexpectedResponse = errors.New("empty response")
|
|
ErrWriteTimeout = errors.New("endpoint write timed out")
|
|
)
|
|
|
|
// RemoteSignerError allows (remote) validators to include meaningful error
|
|
// descriptions in their reply.
|
|
type RemoteSignerError struct {
|
|
// TODO(ismail): create an enum of known errors
|
|
Code int
|
|
Description string
|
|
}
|
|
|
|
func (e *RemoteSignerError) Error() string {
|
|
return fmt.Sprintf("signerEndpoint returned error #%d: %s", e.Code, e.Description)
|
|
}
|