Re: Catching exceptions from a FileSystemWatcher event handler

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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?

--
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
-------------------------------------------------------------------------------


"Ole" <Ole@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:30CA8812-1C45-4012-BE9F-6B4D16D2AD76@xxxxxxxxxxxxxxxx
> 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
>
>


.



Relevant Pages

  • RE: BackgroungWork taske ended for no appearent reason
    ... If there was any exception thrown in your DoWork event handler, ... If the operation raises an exception that your code does not handle, ... RunWorkerCompleted event handler, where it is exposed as the Error property ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Combobox fun - "Specified argument was out of the range..."
    ... I tried disabling the event handler, ... exception, the combobox refills with Class.Property. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to catch custom errors raised in SP gracefully?
    ... I can't get the event handler ... to throw a new exception, ... Console.Writeline, or HttpResponse.Write, the error message from the event ... >>missing, FK violation etc), because if I purposely raise an error, I sure ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Exception handling suggestions
    ... Ok, if this is for a windows app, what is "main"? ... You can add the event handler anywhere, but it's best to do it as ... and it's usually where you set up global exception ... catch an exception unless you can take some substantial action ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: System.NullReference exception
    ... If an exception goes unhandled in a .NET 2.0 application, ... there is actually another source of UnhandledException: ... Application.ThreadException is used to add the event handler for handling UI ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)