@@ 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,