Re: on error against try..catch

Tech-Archive recommends: Fix windows errors by optimizing your registry



What kind of errors have you *seen* in this portion of code ?

This is one point where try/cast can help as you can catch only those
exception that are of a given class. This way you can catch errors that
could arise (for example file io errrors when saving a file) but you can
still have more unexpected errors to raise a generic message and warns the
support team.

I wanted to convey the opinion that IMO the worst thing in error hanlding is
to "hide" errors that are not signaleds to the support team and/or the
user...






--
Patrice

"DavideR" <DavideR@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le message de
news:4E79E550-5771-4691-B65D-712F1C7ECA1D@xxxxxxxxxxxxxxxx
> in some routine like mousemove, graphical drawing etc i sometimes i use
> resume next for continue execution of the code for not display a blank
screen
> (i display an incorrect screen but not blank(this is not my decision but
its
> so for a long time for customer's impact ! ?!?)
> and then i re-establish the herrhandling
> So nothing to do?? it's already allright?
> Thanks for reply
> :?)
>
> "Patrice" wrote:
>
> > Yes, this is included for legacy. Actually the underyling MSIL code for
on
> > error uses Try/Catch...
> >
> > Try :
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vaconTryCatchStatements.asp
> >
> > You are allowed to do nothing when an exception is raised but I would
still
> > double check that I can't do otherwise (bascially it should IMO never be
> > done, what is your scenario ?).
> >
> > --
> > Patrice
> >
> > "DavideR" <DavideR@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le message de
> > news:4B0EF2A5-A492-4095-899D-B36629835FB3@xxxxxxxxxxxxxxxx
> > > I have converted a large vb6 program with an add-in that for every
routine
> > > gimme
> > > the error handling:
> > > the add-in adds one line on the head of the routine
> > > "if myerrhandle then ON ERROR GOTO HERRHANDLER"
> > > and the herrhandler label at the botton where i write in a logfile
the
> > name
> > > of the routine, the errors and other information
> > > Well setting myerrhandle to true seems that the error handling keeps
on
> > > working in
> > > .net is it right? what's the difference from exception handling?
> > > if exception handling is better like i think how can i do to pass from
> > > errhandling to excection handling?
> > > Some times i use on error resume next has got
> > > handling exception an equivalent?
> > > Thasnks
> > > Best Regards
> > > DavideR
> >
> >
> >


.



Relevant Pages

  • Re: on error against try..catch
    ... You are allowed to do nothing when an exception is raised but I would still ... > I have converted a large vb6 program with an add-in that for every routine ... > "if myerrhandle then ON ERROR GOTO HERRHANDLER" ... > Well setting myerrhandle to true seems that the error handling keeps on ...
    (microsoft.public.dotnet.general)
  • Re: best pratices in Exception Handling
    ... > I am looking for a guide on design and architecture in Exception ... > actually design a sensible Exception handling. ... Routine B calls A ...
    (comp.lang.java.programmer)
  • Re: Practical error/exception handling...
    ... Could I humbly suggest that the requirement for a 'standard' way of handling ... But I only need the exception handler in ... > and is informative to both user and developer when errors occur. ...
    (alt.comp.lang.borland-delphi)
  • Re: Error handling - Resume vs Exit
    ... I always wondered why Access wizards created simple exception ... handling code in the fashion they do. ... Use a separate subroutine for each try block. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Rationale behind unwind-protect and double errors
    ... try/finally exception handling system. ... C++ programmers usually use destructors for the same purpose. ... handling, which does not use the mechanism you outline. ...
    (comp.lang.lisp)