Skip to content

Commit

Permalink
Make PeerConnection constructor with WebIDL errors
Browse files Browse the repository at this point in the history
According to https://w3c.github.io/webrtc-pc/#constructor defined.
there are WebIDL errors should be returned when constructor failed.
  • Loading branch information
soolaugust authored and Sean-Der committed Aug 21, 2020
1 parent 0a6f28a commit 98e6612
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/pion/logging"
)

// API bundles the global funcions of the WebRTC and ORTC API.
// API bundles the global functions of the WebRTC and ORTC API.
// Some of these functions are also exported globally using the
// defaultAPI object. Note that the global version of the API
// may be phased out in the future.
Expand Down
2 changes: 1 addition & 1 deletion icecredentialtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package webrtc
type ICECredentialType int

const (
// ICECredentialTypePassword describes username and pasword based
// ICECredentialTypePassword describes username and password based
// credentials as described in https://tools.ietf.org/html/rfc5389.
ICECredentialTypePassword ICECredentialType = iota

Expand Down
2 changes: 1 addition & 1 deletion iceserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s ICEServer) urls() ([]*ice.URL, error) {
for i := range s.URLs {
url, err := s.parseURL(i)
if err != nil {
return nil, err
return nil, &rtcerr.InvalidAccessError{Err: err}
}

if url.Scheme == ice.SchemeTypeTURN || url.Scheme == ice.SchemeTypeTURNS {
Expand Down
2 changes: 1 addition & 1 deletion iceserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestICEServer_validate(t *testing.T) {
Username: "unittest",
Credential: false,
CredentialType: ICECredentialTypeOauth,
}, ice.ErrSTUNQuery},
}, &rtcerr.InvalidAccessError{Err: ice.ErrSTUNQuery}},
}

for i, testCase := range testCases {
Expand Down

0 comments on commit 98e6612

Please sign in to comment.