Bug 662192 Comment 7 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Revision mainly to tidy up jsdoc use.

Kind of at the outer limits of my JS knowledge here - in particular my implementation of `Connection.read()` seems a little off: mixing Promises with async. Suggestions for improvement welcome!

(In reply to Magnus Melin [:mkmelin] from comment #6)
> ::: mailnews/test/fakeserver/Binaryd.jsm
> @@ +105,5 @@
> > +            // if we get here, assume the error occured because we're
> > +            // shutting down, and ignore it.
> > +          } else {
> > +            // if we get here, something went wrong.
> > +            dump("ERROR " + e.toString());
> 
> Should the error be let un-caught instead?
> 
> @@ +109,5 @@
> > +            dump("ERROR " + e.toString());
> > +          }
> > +        }
> > +        conn.close();
> > +        delete server._connections[connID];
> 
> and these in a finally clause?

I'm not sure yet. For a real server, you want it to keep running even if one connection explodes, so I kind of think our fake server should aim for that. But for testing purposes it could be nice if the whole server explodes too :-)
I've left it as is for now. It can be revisited if some tests require a change.
Revision mainly to tidy up jsdoc use.

Kind of at the outer limits of my JS knowledge here - in particular my implementation of `Connection.read()` seems a little off: mixing Promises with async. Suggestions for improvement welcome!

(In reply to Magnus Melin [:mkmelin] from comment #6)
```
> ::: mailnews/test/fakeserver/Binaryd.jsm
> @@ +105,5 @@
> > +            // if we get here, assume the error occured because we're
> > +            // shutting down, and ignore it.
> > +          } else {
> > +            // if we get here, something went wrong.
> > +            dump("ERROR " + e.toString());
> 
> Should the error be let un-caught instead?
> 
> @@ +109,5 @@
> > +            dump("ERROR " + e.toString());
> > +          }
> > +        }
> > +        conn.close();
> > +        delete server._connections[connID];
> 
> and these in a finally clause?
```
I'm not sure yet. For a real server, you want it to keep running even if one connection explodes, so I kind of think our fake server should aim for that. But for testing purposes it could be nice if the whole server explodes too :-)
I've left it as is for now. It can be revisited if some tests require a change.

Back to Bug 662192 Comment 7