Thrown Error NOT Caught!?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chopsnsauce

    #1

    Thrown Error NOT Caught!?

    Here is the problem.
    I'm opening a form that Throw's an error in the Load event and the method
    thant opens the form has a try..Catch to Catch the error that is thrown in
    the load event.

    This works fine running through the design-time enviroment. But if I run
    the .EXE it says Unhandled Exception and quits. WHY?

    How do I fix this???

    Nick
  • Herfried K. Wagner [MVP]

    #2
    Re: Thrown Error NOT Caught!?

    "chopsnsauc e" <chopsnsauce@di scussions.micro soft.com> schrieb:[color=blue]
    > I'm opening a form that Throw's an error in the Load event and the method
    > thant opens the form has a try..Catch to Catch the error that is thrown
    > in
    > the load event.
    >
    > This works fine running through the design-time enviroment. But if I run
    > the .EXE it says Unhandled Exception and quits. WHY?[/color]

    Take a look at 'Application.Th readException' in the documentation.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • chopsnsauce

      #3
      Re: Thrown Error NOT Caught!?

      Well that gives me a work round. But I want the method that opens the form
      to catch the exception.

      Like I said, when I run my App through the IDE the exceception is caught.
      When I run the EXE the exception is unhadles. I want the EXE to catch the
      exception as well. Its the same code so why should it behave differently??

      Regards,

      Nick

      "Herfried K. Wagner [MVP]" wrote:
      [color=blue]
      > "chopsnsauc e" <chopsnsauce@di scussions.micro soft.com> schrieb:[color=green]
      > > I'm opening a form that Throw's an error in the Load event and the method
      > > thant opens the form has a try..Catch to Catch the error that is thrown
      > > in
      > > the load event.
      > >
      > > This works fine running through the design-time enviroment. But if I run
      > > the .EXE it says Unhandled Exception and quits. WHY?[/color]
      >
      > Take a look at 'Application.Th readException' in the documentation.
      >
      > --
      > M S Herfried K. Wagner
      > M V P <URL:http://dotnet.mvps.org/>
      > V B <URL:http://classicvb.org/petition/>
      >
      >[/color]

      Comment

      • Chris Dunaway

        #4
        Re: Thrown Error NOT Caught!?

        I believe this is the result of a bug. The IDE handles catching the
        exception differently somehow. There was a discussion about this in
        the last few weeks on this group.

        Comment

        • chopsnsauce

          #5
          Re: Thrown Error NOT Caught!?

          Do you have a link to this?

          Nick

          "Chris Dunaway" wrote:
          [color=blue]
          > I believe this is the result of a bug. The IDE handles catching the
          > exception differently somehow. There was a discussion about this in
          > the last few weeks on this group.
          >
          >[/color]

          Comment

          Working...