Skip to content

Commit

Permalink
improve webrtc error messages (Fix Error: [object RTCErrorEvent])
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Apr 22, 2020
1 parent 8c9ecf4 commit 519d515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function filterTrickle (sdp) {
return sdp.replace(/a=ice-options:trickle\s\n/g, '')
}

function makeError (message, code) {
var err = new Error(message)
function makeError (err, code) {
if (!(err instanceof Error)) err = new Error(err)
err.code = code
return err
}
Expand Down

0 comments on commit 519d515

Please sign in to comment.