Hey Frank,

After reviewing the documentation, I have to admit your remark is correct:
the documentation is confusing.

In reality, most errors will be reported by throwing exceptions.

If the server was already running, start() will return false, and (for
wthttp) if the server does not have to be stopped because Wt was compiled
without thread support (and the server will thus execute in the context of
the main thread), start() will also return false.

I believe we should document the return value of start() as indication of
the need of calling stop(): if start() returns true, the server has to be
stopped by calling stop(). If start() returns false, no extra instance of
the server is running. I'm not sure if all connectors correctly implement
this behaviour at this point, though.

Best regards,
Wim.


On 3 November 2016 at 22:55, K. Frank <kfrank2...@gmail.com> wrote:

> Hello List!
>
> Does WServer::start() ever return false, or does it always signal
> error conditions by throwing exceptions?
>
> I find the documentation either contradictory or ambiguous.
>
>
> Thanks.
>
>
> On Mon, Oct 31, 2016 at 9:23 AM, K. Frank <kfrank2...@gmail.com> wrote:
> > Hello List!
> >
> > I have two questions about WServer error handling:
> >
> > (This is wt-3.3.3 compiled with mingw-w64 on windows 7.)
> > ...
> > My second questions is about the WServer documentation and
> > error handling.
> >
> > The documentation for  WServer::start():
> >
> >    WTCONNECTOR_API bool Wt::WServer::start()
> >
> >    Starts the server in the background.
> >
> >    Returns whether the server could be successfully started.
> >
> >    Exceptions
> >    Exception: indicates a problem starting the server.
> >
> > This seems to be saying that when WServer::start() encounters
> > an error (regardless of whether my above example counts as
> > an error), the error condition is reported by returning false and
> > by throwing an exception.  Of course, you can't actually do
> > both.
> >
> > Are there two different classes of WServer::start() errors (maybe
> > for historical reasons), some of which are reported with a false
> > return value, and others that are reported with a thrown exception?
> >
> > Anyway, what are the recommended best practices for handling
> > WServer::start() error conditions?
> >
> > Thanks.
> >
> > K. Frank
>
> ------------------------------------------------------------
> ------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to