S
stephen
Hi,
I am a lil confused about exception handling. I have a main app and i am
importing 2 DLL's. one of the DLL's is for connection/datasets etc and the
other has logging errors to file.Both DLL's have try{} catch(exception
ex){throw ex; } and i am force feeding errors so that I can catch the
exceptions.
I have done this:
1. for DLL1 (Logging Errors), I am force feeding (5/0) and it throws
"Attempted to divide by zero." exception and its propagating to the parent
2. for DLL 2 (connnection/datasets), I am writing a non-existing STP and it
thows "System.Data.SqlClient.SqlException Message: Could not find stored
procedure 'stp_XXXX'. exception and its propagating to the parent
3. the same DLL (DLL 2), I am passing a non-existent DB and it throws
"System.NullReferenceException Message: Object reference not set to an
instance of an object." exception and its propagating to the parent I want a
proper error message "DB does not exist or something" but it does not.
I have debugged the application and i observe that in the catch of DLL2, it
does show me propermessage but when it propagates to the parent the message
is lost. Can someone please explain what I am doing wrong?
Thanks for your help,
Stephen
I am a lil confused about exception handling. I have a main app and i am
importing 2 DLL's. one of the DLL's is for connection/datasets etc and the
other has logging errors to file.Both DLL's have try{} catch(exception
ex){throw ex; } and i am force feeding errors so that I can catch the
exceptions.
I have done this:
1. for DLL1 (Logging Errors), I am force feeding (5/0) and it throws
"Attempted to divide by zero." exception and its propagating to the parent
2. for DLL 2 (connnection/datasets), I am writing a non-existing STP and it
thows "System.Data.SqlClient.SqlException Message: Could not find stored
procedure 'stp_XXXX'. exception and its propagating to the parent
3. the same DLL (DLL 2), I am passing a non-existent DB and it throws
"System.NullReferenceException Message: Object reference not set to an
instance of an object." exception and its propagating to the parent I want a
proper error message "DB does not exist or something" but it does not.
I have debugged the application and i observe that in the catch of DLL2, it
does show me propermessage but when it propagates to the parent the message
is lost. Can someone please explain what I am doing wrong?
Thanks for your help,
Stephen