[fpc-pascal] CGI, Handle Exceptions

Marcos Douglas md at delfire.net
Wed Jul 20 17:55:24 CEST 2016


On Wed, Jul 20, 2016 at 12:40 PM, Michael Van Canneyt <
michael at freepascal.org> wrote:

>
>
> On Wed, 20 Jul 2016, Marcos Douglas wrote:
>
> Hi,
>>
>> Is possible to get all exceptions in one place, in a CGI/FastCGI programs?
>>
>> I need to know the Request instance too, to treat the exception properly.
>>
>
> No, you cannot.
>
> You can override Application.ShowException, but then you do not know the
> current request.
>
> What I do is make a descendent of TFPWebModule which overrides
> "HandleRequest', and which handles exceptions in a generic way.
> It returns JSON when the request expects JSON etc.
>
> All my other modules are descendent of this descendent.
>

Hmm, could be a solution. Thank you.

Marcos Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160720/108a9997/attachment.html>


More information about the fpc-pascal mailing list