refactor: examples-browser (#508)

* refactor: examples-browser

* chore: add information to use signalling server

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: update deps

* docs: refactor libp2p browser example

* docs(examples): add back websockets and boostrap nodes

docs(examples): redo the browser readme

* fix: handle edge case of connections closing early

* chore: fix lint

* chore: update example deps and readme

* chore: update webrtc-star

* chore: apply suggestions from code review

Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
This commit is contained in:
Vasco Santos
2020-01-24 17:43:56 +07:00
committed by Jacob Heun
parent d21b7ce4ff
commit 560d7084fe
14 changed files with 190 additions and 245 deletions

View File

@ -86,8 +86,8 @@ class TransportManager {
try {
return await transport.dial(ma, options)
} catch (err) {
if (err.code) throw err
throw errCode(err, codes.ERR_TRANSPORT_DIAL_FAILED)
if (!err.code) err.code = codes.ERR_TRANSPORT_DIAL_FAILED
throw err
}
}