~bfiedler/go-threema

efc286b1c5a105bc653950f41f7cca601903b943 — Ben Fiedler 3 years ago de09bc9
Clarify error naming scheme
1 files changed, 4 insertions(+), 3 deletions(-)

M client/client.go
M client/client.go => client/client.go +4 -3
@@ 35,9 35,11 @@ const (
)

var (
	// Caller errors
	ErrInvalidPhoneNumber = errors.New("invalid phone number, must consist of at most 15 digits")
	ErrIDLength = errors.New("id must be exactly 8 bytes long")

	// http errors
	// API errors
	ErrInvalidRequest = errors.New("invalid recipient or identity not set up for chosen mode (simple/e2e)")
	ErrMissingBlob    = errors.New("missing parameters or blob is empty")
	ErrCredentials    = errors.New("wrong id or secret for API")


@@ 46,10 48,9 @@ var (
	ErrMessageTooLong = errors.New("message too long")
	ErrBlobTooLarge   = errors.New("blob too large")
	ErrTemporary      = errors.New("temporary API failure")
	ErrUnknown        = errors.New("unknown error")
	ErrUnknown        = errors.New("unknown API error")

	phoneNumberInverted   = regexp.MustCompile("[^0-9]+")
	ErrInvalidPhoneNumber = errors.New("invalid phone number, must consist of at most 15 digits")

	emailHMACKey = []byte{0x30, 0xa5, 0x50, 0x0f, 0xed, 0x97, 0x01, 0xfa,
		0x6d, 0xef, 0xdb, 0x61, 0x08, 0x41, 0x90, 0x0f, 0xeb, 0xb8, 0xe4, 0x30,