Skip to content

Commit

Permalink
Tweak error messages, latest phonenumbers
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Aug 14, 2019
1 parent 7b1e7e4 commit 3a07dc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/nyaruka/gocommon v1.1.0
github.com/nyaruka/librato v0.0.0-20180827155909-cacc769357b8
github.com/nyaruka/null v1.1.1
github.com/nyaruka/phonenumbers v1.0.36 // indirect
github.com/nyaruka/phonenumbers v1.0.44 // indirect
github.com/onsi/ginkgo v1.7.0 // indirect
github.com/onsi/gomega v1.4.3 // indirect
github.com/pkg/errors v0.8.0
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/schema v1.0.2 h1:sAgNfOcNYvdDSrzGHVy9nzCQahG+qmsg+nE8dK85QRA=
Expand Down Expand Up @@ -76,8 +78,9 @@ github.com/nyaruka/librato v0.0.0-20180827155909-cacc769357b8 h1:TOvxy0u6LNTWP3g
github.com/nyaruka/librato v0.0.0-20180827155909-cacc769357b8/go.mod h1:huVocfMEHkttMHD4hSr/wjWNyTx/YMzwwajVzV2bq+0=
github.com/nyaruka/null v1.1.1 h1:kRy1Luj7jUHWEFqc2J6VXrKYi/beLEZdS1C7rA6vqTE=
github.com/nyaruka/null v1.1.1/go.mod h1:HSAFbLNOaEhHnoU0VCveCPz0GDtJ3GEtFWhvnBNkhPE=
github.com/nyaruka/phonenumbers v1.0.36 h1:NaQcpW0p4jojGXGvdfVXCeJKrI9gKerdctgbTHPRqyo=
github.com/nyaruka/phonenumbers v1.0.36/go.mod h1:Hhae+eypC1YKMaQlBJUCGZDzBrIHHNWhJX1xG/8sOC8=
github.com/nyaruka/phonenumbers v1.0.34/go.mod h1:GQ0cTHlrxPrhoLwyQ1blyN1hO794ygt6FTHWrFB5SSc=
github.com/nyaruka/phonenumbers v1.0.44 h1:8afcAqD/cgsegfkRzk38Y/Lg0yoUdEA+QiQZol38Seo=
github.com/nyaruka/phonenumbers v1.0.44/go.mod h1:hrAQeqt4LIJ20aSiHeA03XG6yo3hHlKoeRc6X8GP190=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
6 changes: 3 additions & 3 deletions handlers/freshchat/freshchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ func (h *handler) SendMsg(ctx context.Context, msg courier.Msg) (courier.MsgStat

agentID := msg.Channel().StringConfigForKey(courier.ConfigUsername, "")
if agentID == "" {
return nil, fmt.Errorf("missing config Username for FC channel")
return nil, fmt.Errorf("missing config 'username' for FC channel")
}

authToken := msg.Channel().StringConfigForKey(courier.ConfigAuthToken, "")
if authToken == "" {
return nil, fmt.Errorf("missing config AuthToken for FC channel")
return nil, fmt.Errorf("missing config 'auth_token' for FC channel")
}

user := strings.Split(msg.URN().Path(), "/")
Expand Down Expand Up @@ -182,7 +182,7 @@ func (h *handler) validateSignature(c courier.Channel, r *http.Request) error {
}
key := c.StringConfigForKey(courier.ConfigSecret, "")
if key == "" {
return fmt.Errorf("missing config Secret for FC channel")
return fmt.Errorf("missing config 'secret' for FC channel")
}
//x509 parser needs newlines for valid key- RP stores config strings without them.
// this puts them back in
Expand Down

0 comments on commit 3a07dc0

Please sign in to comment.