[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Rethrowing exception from a thread

Posted on 2008-06-15
1
Medium Priority
?
808 Views
Last Modified: 2012-03-15
Hi,

I created a web service that invokes  a thread that sends e-mails.
When the connection to the internet is terminated, this thread throws an exception.
I want to rethrow that exception to the client.
I tried to use the following code :

                         try
                        {
                            SmtpMail.Send(mailMessage);
                        }
                        catch (HttpException exc)
                        {
                            throw new HttpException(exc.GetHttpCode(), exc.Message);
                        }
but since we are in a thread, and nobody can catch the rethrown exception.
Please tell me how to throw an exception from a thread, so that it will can rethrown to the client.

Thanks
Michael
0
Comment
Question by:MichaelMarom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 13

Accepted Solution

by:
iHadi earned 500 total points
ID: 21790010
Try to invoke an event instead. Declare an event and invoke it instead of throwing an exception
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question