Skip to content

Commit

Permalink
improve webrtc error messages (Fix Error: [object RTCErrorEvent])
Browse files Browse the repository at this point in the history
Complete fix for the issue I attempted to fix in 519d515
  • Loading branch information
feross committed May 11, 2020
1 parent 1eda423 commit 524c292
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -15,7 +15,8 @@ function filterTrickle (sdp) {
}

function makeError (err, code) {
if (!(err instanceof Error)) err = new Error(err)
if (typeof err === 'string') err = new Error(err)
if (err.error instanceof Error) err = err.error
err.code = code
return err
}
Expand Down

0 comments on commit 524c292

Please sign in to comment.