Exception handling and the call stack?

  • Thread starter Thread starter Vagabond Software
  • Start date Start date
V

Vagabond Software

An ASP app is calling a T-SQL stored procedure, which creates and instance of a DLL and calls one of its methods. The DLL method creates an instance of an API to process credit card transactions.

The client is seeing an OLE DB object error message, presumably raised by the ASP app after the stored procedure fails to call the DLL method. However, I believe the actual failure is occuring when the DLL method attempts to create an instance of the API.

Any links or advice on how to get to the bottom (literally) of the error message and find the actual exception from the actual source would be greatly appreciated.

- carl
 
Carl,

I think that the best you are going to be able to do is get the error
message that SQL Server throws back to you. You should get an exception
when the stored proc is called. You should catch it, and check the Errors
property. There should be a SqlError instance that has information about
the OLE error code. At that point, I think you would have to parse it apart
for the code. Once you have that, you can pass the value to the static
ThrowExceptionForHR method on the Marshal class to throw an exception that
maps to that code.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

An ASP app is calling a T-SQL stored procedure, which creates and instance
of a DLL and calls one of its methods. The DLL method creates an instance
of an API to process credit card transactions.

The client is seeing an OLE DB object error message, presumably raised by
the ASP app after the stored procedure fails to call the DLL method.
However, I believe the actual failure is occuring when the DLL method
attempts to create an instance of the API.

Any links or advice on how to get to the bottom (literally) of the error
message and find the actual exception from the actual source would be
greatly appreciated.

- carl
 
Back
Top