Skip to content

Commit

Permalink
return a nicier message if the session-id has expired
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Jan 13, 2023
1 parent 7a952b4 commit e0c4d0b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sequencerclient/sequencerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func (c *Client) TryContribute(ctx context.Context, sessionID string) (*contribu
}
defer res.Body.Close()

if res.StatusCode == http.StatusUnauthorized {
return nil, false, fmt.Errorf("wrong or expired session-id, login again with the sequencer")
}
if res.StatusCode != http.StatusOK {
return nil, false, fmt.Errorf("received status code %d", res.StatusCode)
}
Expand Down

0 comments on commit e0c4d0b

Please sign in to comment.