TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marc
NA
205
54k
Catching Exception by Source
Jan 23 2015 8:31 AM
What I am trying to accomplish is catch an exception by the actual method that's being called. This is what I got so far, but what I found out is its only catching the exception by the namespace.
public static void ExceptionHandler(Exception ex)
{
if (ex.Source.Contains("Service"))
{
Console.WriteLine("***Warning: " + ex.Message + " Source: " + ex.Source);
}
if (ex.Source.Contains("SetServiceController"))
{
Console.WriteLine("***Error: " + ex.Message + " Source: " + ex.Source);
}
Console.WriteLine("Error: " + ex.Message + " Source: " + ex.Source);
}
Reply
Answers (
2
)
write EID in Datagridview cel fill automatically another cel
how do get last record from sql