Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I want to catch any soapexception error by these method.

My question is Does creating an instance from assembly name can retrieve exception errors from UI? I have read documents on handling soapexception errors but i want to make it general on this. Is this procedure posible? Because it returns an error message of "HRESULT has returned from a call to a COM Component."

 

I hope you could help me on this. Any idea would be a great help! Thanks!

 

Chris.

 

===============================================

catch(Exception err)

{

throw (Exception)CreateObjectInstance(err);

}

 

private object CreateObjectInstance(Exception err)

{

Object obj;

Assembly[] assemblyArray;

string str = err.Message.Substring(err.Message.IndexOf("---> ") + 5,

err.Message.IndexOf(" (") - err.Message.IndexOf("---> ") - 5);

 

assemblyArray = new Assembly[AppDomain.CurrentDomain.GetAssemblies().Length];

assemblyArray = AppDomain.CurrentDomain.GetAssemblies();

 

foreach(Assembly assembly in assemblyArray)

{

Type[] mytypes = assembly.GetTypes();

foreach(Type t in mytypes)

{

if(t.FullName == str)

{

obj = Activator.CreateInstance(t)

return obj;

}

}

}

return null;

}

===============================================

  • Moderators
Posted

try this...

try {
   //''code goes here. 
}
Catch COMException ce
      {
    Context.Trace.Write (ce, "COMException caught.") ;
   switch (ce.ErrorCode )
        case &H80070005 :
               throw new SecurityException("something", ce) ;
               //''Additional statement go here. 
               break;
        } 
}

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...