Skip to content

Commit

Permalink
Fixed error handling for Session
Browse files Browse the repository at this point in the history
  • Loading branch information
guilherme-marcello authored Mar 26, 2023
1 parent a0f0ec8 commit 61eb433
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ type Session struct {
Endpoint string
}

func New(client janus.Http) Session {
func New(client janus.Http) (Session, error) {
session := Session{
client: client,
}
session.id = session.getId()
var err error
session.id, err = session.getId()
if err != nil {
return Session{}, err
}
session.Endpoint = session.getEndpoint()
return session
return session, nil
}

func (_session Session) getId() (string, error) {
Expand Down

0 comments on commit 61eb433

Please sign in to comment.