Skip to content

Commit

Permalink
better err handling for creating conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
juzeon committed Feb 16, 2024
1 parent febd7f1 commit 4bb4ff9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sydney/conversation.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func (o *Sydney) createConversation() (CreateConversationResponse, error) {
if err != nil {
return emptyResponse, err
}
if response.Result.Value == "UnauthorizedRequest" {
return emptyResponse, errors.New(response.Result.Message)
if response.Result.Value != "Success" {
return emptyResponse, errors.New("failed to create the conversation: message: " + response.Result.Message)
}
if value := resp.Header.Get("X-Sydney-Encryptedconversationsignature"); value != "" {
response.SecAccessToken = value
Expand Down

0 comments on commit 4bb4ff9

Please sign in to comment.