I use delphi 7 and SecureBridge 10.1.1.
Could you please explain to me why the HttpException block is not executed (ignored) but the E: exception block is executed in the following code example:
Try
........
........
CLIResponse:= CLIRequest.GetResponse;
........
........
Except
On E: HttpException Do
Begin
ResponseError:= True;
ErrorCode:= E.Code;
ErrorCode2:= E.HelpContext;
ErrorStr:= E.Message;
End;
on E: Exception do
begin
ResponseError:= True;
ErrorStr:= HttpException(E).Message;
ErrorCode:= Ord(HttpException(E).StatusCode);
ErrorCode2:= HttpException(E).Code;
end;
End;
Even if the On E: Exception block is removed the on E: HttpException does not excecute
On a disconnected internet connection it returns for instance:
ErrorCode= 64
ErrorCode2= 0
ErrorStr=
Unknown host 'uatsim.imbeko.live'.
Socket Error Code: 11001($2AF9)
On a request timeout it returns:
ErrorCode= 64
ErrorCode2= 0
ErrorStr=
Error on data reading from the connection:
An existing connection was forcibly closed by the remote host
I need to be able to get an accurate TScHttpStatusCode to be able to map the error (64) to a specific action to take. When catching the normal on E: exception it returns the same error code for both instances. The errorcode 64 can not be linked to the ordinal value of the TScHttpStatusCode as it falls outside the range of 0-47 (scAccepted .. scUnknown).
It is important to get the corrrect HttPexception statuscode in order to perform different actions for different exceptions
HttpException exception block not executing & errorcode mapping
Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Jump to
- General Forums
- ↳ Announcements
- Database Tools
- ↳ dbForge for MySQL
- ↳ dbForge for Oracle
- ↳ dbForge for PostgreSQL
- ↳ dbForge for SQL Server
- ADO.NET Data Providers
- ↳ Entity Framework support
- ↳ LinqConnect (LINQ to SQL support)
- ↳ dotConnect for Oracle
- ↳ dotConnect for MySQL
- ↳ dotConnect for PostgreSQL
- ↳ dotConnect for SQLite
- ↳ dotConnect for DB2
- ↳ dotConnect for SQL Server
- ↳ dotConnect for Cloud Applications
- ↳ dotConnect Universal
- ↳ Entity Developer
- Delphi Data Access Components
- ↳ EntityDAC
- ↳ Universal Data Access Components
- ↳ Oracle Data Access Components
- ↳ SQL Server Data Access Components
- ↳ MySQL Data Access Components
- ↳ InterBase Data Access Components
- ↳ PostgreSQL Data Access Components
- ↳ SQLite Data Access Components
- ↳ VirtualDAC
- dbExpress Drivers
- ↳ dbExpress driver for Oracle
- ↳ dbExpress driver for SQL Server
- ↳ dbExpress driver for MySQL
- ↳ dbExpress driver for InterBase & Firebird
- ↳ dbExpress driver for PostgreSQL
- ↳ dbExpress driver for SQLite
- ODBC Drivers
- ↳ ODBC Drivers
- Network Security
- ↳ SecureBridge
- Developer Tools
- ↳ Code Compare
- ↳ Review Assistant
- ↳ LINQ Insight
- ↳ SSIS Data Flow Components
- ↳ Excel Add-ins