User and System exceptions

delphi package - automated exception handling
Post Reply
nickosl50@gmail.com
Posts: 4
Joined: Tue Mar 22, 2016 11:19 am

User and System exceptions

Post by nickosl50@gmail.com »

I installed madexception in Delphi XE6 in order to find out why I get 'Access violation..' errors in my program. In my code I also have 'raise exception.Create(<my message>)' in order to inform the user about invalid actions. I realised that madexcept dialog appears not only for exceptions caused problematic code but also with my own created exceptions. I wonder if I there is a way to disallow my own created exceptions to use madexcept dialog to appear.

Thank you very much in advance
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: User and System exceptions

Post by madshi »

Have you simply used "Exception" or a custom exception class? If you had your own exception class, you could filter by class here:

http://help.madshi.net/madExceptSettings3.htm

You can add the class there after "EDBEditError" (comma separated, IIRC). If you're simply using "raise Exception.", maybe you can do a search and replace through your whole code to replace "raise Exception." with "raise WhateverException."?
nickosl50@gmail.com
Posts: 4
Joined: Tue Mar 22, 2016 11:19 am

Re: User and System exceptions

Post by nickosl50@gmail.com »

I used
type MyException = class (Exception);

inside my code I use raise MyException.Create(<my own message'>
and I set the madexcept Exception filter as follows:
Classes : EDBEditError, MyException
Don't create a bug report (checked)
Don't create a screen shots (checked)
Don't pause the running threads (checked)
Don't call the exception handlers (checked)

and show a simple message box

when i run the program and i cause myexception to occur the full exception box appears with bug report , screen hots etc buttons active.

I wonder what I did wrong

Thank you
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: User and System exceptions

Post by madshi »

I've just tested it with:

Code: Select all

type MyException = class (Exception);

begin
  raise MyException.Create('test');
And it works for me here. Can you reproduce this problem in a simple test project?
nickosl50@gmail.com
Posts: 4
Joined: Tue Mar 22, 2016 11:19 am

Re: User and System exceptions

Post by nickosl50@gmail.com »

Sorry I found my mistake.

Thank you very much for your quick response
Post Reply