:: Re: [DNG] C exception handling
Top Pagina
Delete this message
Reply to this message
Auteur: Didier Kryn
Datum:  
Aan: dng@lists.dyne.org
Onderwerp: Re: [DNG] C exception handling
Le 02/11/2024 à 15:19, Hendrik Boom a écrit :
> On Sat, Nov 02, 2024 at 02:36:57PM +0100, Didier Kryn wrote:
> ...
>>     When parsing human input, bogus is normal in some sense, because
>> humans
>> always make errors; but the work-flow of the program changes
>> radically: when
>> finding a bogus, the normal work, which consists of interpreting the
>> semantics and building an internal representation of the input, just
>> stops,
>> and the program switches to handling the bogus, that it issue a
>> diagnostic,
>> and either stop or continue to analyze another part of the input
>> after some
>> clean-up. So that the situation *is* exceptional for the program. In the
>> case of a compiler, the bogus case may even be more likely than the
>> no-bogus
>> case (~: but the work is completely different.
> And does the HTML 1.1 standard specify or encourage particular repairs
> of the bogus?


    The response should contain status=400, reason="Bad request", as
per RFC2616 section-10.4.3. The server may add some HTML page to explain
it to the human user of the client.

    Then the sever should find a way to flush the rest of the input and
wait for the next request. The only way I know to flush for sure the
rest of the input is to disconnect.

--     Didier