Changeset 104 for Network/CoolWeb/WebServer/UHTTPServer.pas
- Timestamp:
- Dec 31, 2010, 9:59:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Network/CoolWeb/WebServer/UHTTPServer.pas
r94 r104 7 7 uses 8 8 Classes, SysUtils, UTCPServer, UCommon, UMemoryStreamEx, UMIMEType, 9 Synautil, Specialized ObjectList, SpecializedList;9 Synautil, SpecializedList; 10 10 11 11 type … … 113 113 SEmptyHTTPHandler = 'No handler defined for HTTP server.'; 114 114 SFileNotFound = 'File %s not found.'; 115 SPageNotFound = 'Page %s not found.'; 115 116 116 117 implementation … … 163 164 begin 164 165 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>'); 166 167 end; 167 168 end; … … 194 195 with Response.Stream do begin 195 196 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>'); 197 198 end; 198 199 end; … … 386 387 WriteLn(hstdout^, 'Content-type: text/html'); 387 388 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/>'); 389 390 if Obj is exception then 390 391 begin 391 392 Message := Exception(Obj).ClassName + ' : ' + Exception(Obj).Message; 392 Writeln(hstdout^, Message );393 Writeln(hstdout^, Message + '<br/>'); 393 394 end 394 395 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/>'); 397 398 if (FrameCount > 0) then 398 399 begin 399 400 for i := 0 to FrameCount - 1 do 400 401 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^, ''); 404 405 end; 405 406 … … 433 434 Writeln(hstderr^, BackTraceStrFunc(TArrayOfPointer(Frames)[i])); 434 435 end; 435 Writeln(hstderr^, '');436 Writeln(hstderr^, ''); 436 437 end; 437 438
Note:
See TracChangeset
for help on using the changeset viewer.