Skip to content

Commit

Permalink
startchat: return proper error if resolve identifier gets an invalid …
Browse files Browse the repository at this point in the history
…input
  • Loading branch information
tulir committed Aug 30, 2024
1 parent 1b862e8 commit 79dad16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/connector/startchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func (gc *GMClient) ResolveIdentifier(ctx context.Context, identifier string, cr
var err error
phone, err = bridgev2.CleanNonInternationalPhoneNumber(identifier)
if err != nil {
return nil, err
zerolog.Ctx(ctx).Debug().Str("input_identifier", identifier).Msg("Invalid phone number passed to ResolveIdentifier")
return nil, bridgev2.WrapRespErrManual(err, mautrix.MInvalidParam.ErrCode, http.StatusBadRequest)
}
}
if !createChat {
Expand Down

0 comments on commit 79dad16

Please sign in to comment.