[fpc-devel] fpweb is not showing the exception message

ABorka fpc-devel at aborka.com
Tue Apr 12 10:31:48 CEST 2011


On 4/12/2011 00:01, michael.vancanneyt at wisa.be wrote:
>
>
> On Mon, 11 Apr 2011, ABorka wrote:
>
>> I was playing today with fpweb a little, and found a simply
>> reproducible minor problem.
>>
>> When one creates a new CGI or FCGI application and creates a simple
>> default action, but NOT setting the "handled := true;" within the
>> event handler, then some kind of exception happens within fpweb when
>> the action is called from the client browser, but it does not return a
>> full response error message page.
>> All that comes back to the client is:
>>
>> "<html><head><title>APPNAME: "
>>
>> where the APPNAME is the title for the application. This happens at
>> least for CGI and FCGI applications, not sure about Apache modules as
>> I did not try that.
>> As soon, as we have "handled := true;" there, everything is OK.
>> If we have "handled := false;" or simply not setting it, the above
>> issue happens. It seems, that there is a problem with displaying error
>> messages/exceptions from within fpweb internals.
>>
>> /Latest FPC and Lazarus SVN, WinXP 32bit/
>
> I cannot reproduce this at least on Linux 64 bit and Windows 2000 32bit.
>
> I am working with these things full-time at the moment, and I always get
> the full page.
>
> Michael.

Yes, it works for me too in Linux 32bit.

But not in WinXP 32bit. In fact, it seems that no matter what, the 
response page is cut off at 30 characters. In custweb.pp of 
.../fcl-web/base/ ,

procedure ExceptionToHTML(S: TStrings; const E: Exception; const Title, 
Email, Administrator: string);

assembles the response page, and for some reason S is only 30 characters 
maximum when it arrives to the client browser.
If I replace the inner part of this procedure with simply

   With S do
     begin
     Add('<html><head>longer than 30 characters here..........');
     end;

it is still cut at 30 characters. Odd :)


AB




More information about the fpc-devel mailing list