![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a EnterpriseServices (ES) component with custom Err.Raise statement Err.Raise(vbObjectError + 9100). When the client tries to trap the error, the err number that is returned from ES component is 5, instead of -2147212404. Kinda weird. Any help is greatly appreciated? |
#3
| |||
| |||
|
|
I'm not certain about your particular case, but I assume you are hosting your ES component in a Server activated "ES application". ES has two modes for communication that among other things will affect how exceptions are treated. Mode 1 is COM Interop with simple (blittable) types, and mode 2 is full .Net serialization. Depending on which mode is chosen (this decision is an internal working of ES) you will see two different error strategies. If it is in "COM Interop" mode it will either give you one of the already known .Net exceptions, or the generic COMException. If it is in .Net serializer mode, it will give you the custom exceptions you are using. Anyways, try adding the plain object type to your method signature and see if it works now. Adding a non-blittable type like "object" will force it into .Net Serializer mode, and you should get the expected exception behavior. Unfortunately there is no way to force ".Net Serializer" and full exception fidelity mode without affacting the method signature or some security settings. Hope this helps, Morty ---- Added Object Type sample ---- public void Test(object myObject, string var, string var2) { } --- Ramesh wrote: I have a EnterpriseServices (ES) component with custom Err.Raise statement Err.Raise(vbObjectError + 9100). When the client tries to trap the error, the err number that is returned from ES component is 5, instead of -2147212404. Kinda weird. Any help is greatly appreciated? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |