github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/sig3/errors.go (about)

     1  package sig3
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  type ParseError struct {
     8  	m string
     9  }
    10  
    11  func (e ParseError) Error() string {
    12  	return fmt.Sprintf("parse error: %s", e.m)
    13  }
    14  
    15  func newParseError(f string, a ...interface{}) error {
    16  	return ParseError{m: fmt.Sprintf(f, a...)}
    17  }
    18  
    19  type Sig3Error struct {
    20  	m string
    21  }
    22  
    23  func (e Sig3Error) Error() string {
    24  	return fmt.Sprintf("sig3 error: %s", e.m)
    25  }
    26  
    27  func newSig3Error(f string, a ...interface{}) error {
    28  	return Sig3Error{m: fmt.Sprintf(f, a...)}
    29  }
    30  
    31  type SequenceError struct {
    32  	m string
    33  }
    34  
    35  func newSequenceError(f string, a ...interface{}) error {
    36  	return SequenceError{m: fmt.Sprintf(f, a...)}
    37  }
    38  
    39  func (e SequenceError) Error() string {
    40  	return fmt.Sprintf("sig3 sequencing error: %s", e.m)
    41  }
    42  
    43  var _ error = ParseError{}
    44  var _ error = Sig3Error{}