Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

Catching exceptions from a FileSystemWatcher event handler

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ole - 05 Aug 2005 11:07 GMT
Hi,

I'm using the FileSystemWatcher to monitor if there are changes to a file.
When the event is raised I do some stuff in a custom event handler sub
routine. It works fine.

However... ;-)

When errors do occur, I throw the exception from the catch part in my event
handler sub routine. But I'm not able to catch that exception outside my
event handler. How is this to be done?

Regards,
Ole
Alvin Bruney [Microsoft MVP] - 05 Aug 2005 20:09 GMT
what are you throwing? You should be able to catch any cls compliant
exception. If it is non cls compliant, you will still be able to catch it
with a catch all filter but you won't be able do anything because there is
no exception object available. did i understand you right?

Signature

Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc
-------------------------------------------------------------------------------

> Hi,
>
[quoted text clipped - 11 lines]
> Regards,
> Ole
Ole - 10 Aug 2005 14:56 GMT
I'm throwing an general Exception e from my eventhandler and I want to catch
that exception in the function that created the watcher.

This function is looping/waiting for the event to occur and eventually
reaches a time out if no file has been found.

What I did belive should happend was that my function which created the
watcher also should catch the exception from my eventhandler like it would
have done if this was a regular call to a sub or function.

Ole

> what are you throwing? You should be able to catch any cls compliant
> exception. If it is non cls compliant, you will still be able to catch it
[quoted text clipped - 16 lines]
> > Regards,
> > Ole

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.