handle my own exeption

i created my own exeption in a function:
 myOwnException is inherited from class (EAbort);
 the command i wrote is: " raise myOwnException.Create('my exeption');"
my problem: i want to continue with the program after handeling the exeption when i
return to the mothers function.
mars_rAsked:
Who is Participating?
 
LRHGuyConnect With a Mentor Commented:
You'll need to use a try..except block around the call to your function:


Try
   CallMyFunction
except
  {handle any exceptions}
end;
{program continues here}

If you want to handle only YOUR exception:

Try
  CallMyFunction
except
  on myownexception do
     Message('Oops!');
end;
0
 
sftwengCommented:
Doesn't
 
try
  {some code}
except
  {handle the exception}
end;
{more code}

work?
0
 
Ivanov_GCommented:
type
  myOwnException = class(Exception)

...

try

except
  on E: MyOwnException do
    begin
      ShowMessage(E.Message);
      Exit;
    end;
end;
0
All Courses

From novice to tech pro — start learning today.