Repo Added
|
Files
39
|
Badge
README BADGES
|
travis-ci
Downgrade middleware stack dump from `warn` to `info` At the moment, if middleware ever returns an `Error` object, its stack trace will get dumped into `logger.warn`. This can be quite noisy, especially if those errors are part of normal control flow (eg authentication). This behaviour can currently be avoided by passing just a `string` to the middleware callback (rather than an `Error` object). However, this is not the "standard" behaviour for callbacks, which will typically be called with an actual `Error` object, rather than a `string` (eg Node's [`fs` module][1]). This change downgrades the logging from `warn` (surprising, but non- critical) to `info` (unsurprising), so that the information is still available to those who want it, but doesn't get the same sort of importance assigned to it as other things we `warn` about, such as: - [stream errors][2] - [`Agent` close errors][3] - [bad messages][4] - [bad acks][5] If consumers want more information about the errors that they are themselves returning, they can naturally add their own logging logic, too. [1]: https://nodejs.org/api/fs.html [2]: https://github.com/share/sharedb/blob/4f8176172/lib/stream-socket.js#L40 [3]: https://github.com/share/sharedb/blob/<a class=hub.com/share/sharedb/commit/<a class="double-link" href="https://git"><a class=hub.com/share/sharedb/commit/985146528a9f63c2ba2d91f99fada7dedf62138a">985146528/lib/agent.js#L51 [4]: https://github.com/share/sharedb/blob/985146528a9f63c2ba2d91f99fada7dedf62138a/lib/client/connection.js#L121 [5]: https://github.com/share/sharedb/blob/985146528a9f63c2ba2d91f99fada7dedf62138a/lib/client/doc.js#L849
2330 of 2784 branches covered (83.69%)
1 of 1 new or added line in 1 file covered. (100.0%)
4984 of 5194 relevant lines covered (95.96%)
465.02 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|