github.com/evdatsion/aphelion-dpos-bft@v0.32.1/privval/errors.go (about)

     1  package privval
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // Socket errors.
     8  var (
     9  	ErrUnexpectedResponse = fmt.Errorf("received unexpected response")
    10  	ErrConnTimeout        = fmt.Errorf("remote signer timed out")
    11  )
    12  
    13  // RemoteSignerError allows (remote) validators to include meaningful error descriptions in their reply.
    14  type RemoteSignerError struct {
    15  	// TODO(ismail): create an enum of known errors
    16  	Code        int
    17  	Description string
    18  }
    19  
    20  func (e *RemoteSignerError) Error() string {
    21  	return fmt.Sprintf("signerServiceEndpoint returned error #%d: %s", e.Code, e.Description)
    22  }