Ignore:
Timestamp:
Dec 31, 2010, 9:59:19 PM (14 years ago)
Author:
george
Message:
  • Přidáno: Třídy THtmlForm. THtmlInput a THtmlLineBreak.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Network/CoolWeb/WebServer/UHTTPServer.pas

    r94 r104  
    77uses
    88  Classes, SysUtils, UTCPServer, UCommon, UMemoryStreamEx, UMIMEType,
    9   Synautil, SpecializedObjectList, SpecializedList;
     9  Synautil, SpecializedList;
    1010
    1111type
     
    113113  SEmptyHTTPHandler = 'No handler defined for HTTP server.';
    114114  SFileNotFound = 'File %s not found.';
     115  SPageNotFound = 'Page %s not found.';
    115116
    116117implementation
     
    163164begin
    164165  with HandlerData, Response.Stream do begin
    165     WriteString('<html><body>Page ' + Request.Path + ' not found.</body></html>');
     166    WriteString('<html><body>' + Format(SPageNotFound, [Request.Path]) + '</body></html>');
    166167  end;
    167168end;
     
    194195    with Response.Stream do begin
    195196      WriteLn(Format(SFileNotFound, [Request.Path]));
    196       WriteString('<html><body>File ' + Request.Path + ' not found.</body></html>');
     197      WriteString('<html><body>' + Format(SFileNotFound, [Request.Path]) + '</body></html>');
    197198    end;
    198199  end;
     
    386387  WriteLn(hstdout^, 'Content-type: text/html');
    387388  WriteLn(hstdout^);
    388   Writeln(hstdout^, 'An unhandled exception occurred at $', HexStr(PtrUInt(Addr), SizeOf(PtrUInt) * 2), ' :');
     389  Writeln(hstdout^, 'An unhandled exception occurred at $', HexStr(PtrUInt(Addr), SizeOf(PtrUInt) * 2), ' :<br/>');
    389390  if Obj is exception then
    390391   begin
    391392     Message := Exception(Obj).ClassName + ' : ' + Exception(Obj).Message;
    392      Writeln(hstdout^, Message);
     393     Writeln(hstdout^, Message + '<br/>');
    393394   end
    394395  else
    395     Writeln(hstdout^, 'Exception object ', Obj.ClassName, ' is not of class Exception.');
    396   Writeln(hstdout^, BackTraceStrFunc(Addr));
     396    Writeln(hstdout^, 'Exception object ', Obj.ClassName, ' is not of class Exception.<br/>');
     397  Writeln(hstdout^, BackTraceStrFunc(Addr) + '<br/>');
    397398  if (FrameCount > 0) then
    398399    begin
    399400      for i := 0 to FrameCount - 1 do
    400401        if I < Length(TArrayOfPointer(Frames)) then
    401           Writeln(hstdout^, BackTraceStrFunc(TArrayOfPointer(Frames)[i]));
    402     end;
    403   Writeln(hstdout^,'');
     402          Writeln(hstdout^, BackTraceStrFunc(TArrayOfPointer(Frames)[i]) + '<br/>');
     403    end;
     404  Writeln(hstdout^, '');
    404405end;
    405406
     
    433434          Writeln(hstderr^, BackTraceStrFunc(TArrayOfPointer(Frames)[i]));
    434435    end;
    435   Writeln(hstderr^,'');
     436  Writeln(hstderr^, '');
    436437end;
    437438
Note: See TracChangeset for help on using the changeset viewer.