Debugger "Ingore this exception type" lazarus / 31-LCL ---------------------------------------------------------------------- Elmug · 2012-08-19 05:20 When debugger shows "Ingore this exception type", and one choses to ignore it, would like verification that this becomes a permanent part of the application, even after more changes. Also, I am not sure if this message shows at run time, so the end-user can ignore the exception, if so chosen. So, does it? ---------------------------------------------------------------------- Leledumbo · 2012-08-19 06:25 QuoteWhen debugger shows "Ingore this exception type", and one choses to ignore it, would like verification that this becomes a permanent part of the application, even after more changes.It's saved in either .lps or .lpi (depending on your settings) AFAIK. QuoteAlso, I am not sure if this message shows at run time, so the end-user can ignore the exception, if so chosen. So, does it?No, the message comes from the debugger catching the exception which is shown by the IDE. Outside debugging environment, it would simply execute the default exception handler installed to the application. ---------------------------------------------------------------------- ludob · 2012-08-19 06:36 The first line of your question is the answer: ignore exception is a debugger setting and his no impact on the application. A little background: exception handling depends on OS/cpu. A common behavior is that exceptions are handled in a chain of exception handlers. Debuggers are inserted or can insert themselves as the first one in the chain. Every exception handler can decide to deal with the exception or hand it over to he next in chain. The configuration you are talking about is exactly that for the debugger. For a debugger handling an exception means stopping the application. Now, when you write a try except block, you explicitely insert yourself in the exception handling chain so that you can do what you want when the exception occurs. FPC also insert a default excpetion handler which is the one you see at work when your program crashes with a stack dump on the console or the popup you see with OK Cancel that displays the exception message. Use try except to handle the exceptions yourself. See the docimentation of try except on how to selectively handle certain types of exceptions and hand the others over to the next in chain. ---------------------------------------------------------------------- Elmug · 2012-08-19 08:13 Quote from: Leledumbo on August 19, 2012, 08:25:00 amQuoteWhen debugger shows "Ingore this exception type", and one choses to ignore it, would like verification that this becomes a permanent part of the application, even after more changes.It's saved in either .lps or .lpi (depending on your settings) AFAIK. QuoteAlso, I am not sure if this message shows at run time, so the end-user can ignore the exception, if so chosen. So, does it?No, the message comes from the debugger catching the exception which is shown by the IDE. Outside debugging environment, it would simply execute the default exception handler installed to the application. Thanks. This checks with what I am finding: The resultant application no longer raises the exception, which is fine, because the exception happens within a DBgrid, when it was finding BCD data, and that data is OK. ---------------------------------------------------------------------- Elmug · 2012-08-19 08:20 Quote from: ludob on August 19, 2012, 08:36:13 amThe first line of your question is the answer: ignore exception is a debugger setting and his no impact on the application. A little background: exception handling depends on OS/cpu. A common behavior is that exceptions are handled in a chain of exception handlers. Debuggers are inserted or can insert themselves as the first one in the chain. Every exception handler can decide to deal with the exception or hand it over to he next in chain. The configuration you are talking about is exactly that for the debugger. For a debugger handling an exception means stopping the application. Now, when you write a try except block, you explicitely insert yourself in the exception handling chain so that you can do what you want when the exception occurs. FPC also insert a default excpetion handler which is the one you see at work when your program crashes with a stack dump on the console or the popup you see with OK Cancel that displays the exception message. Use try except to handle the exceptions yourself. See the docimentation of try except on how to selectively handle certain types of exceptions and hand the others over to the next in chain. I can't use try blocks because the "error" detection happens within the grid when it finds BCD data in a cell,  in an SQLite3 database. At debug time, I accepted "ignore this type of excepton", and thereafter the application does not raise the error and runs fine. As Leledumbo says, the "ignoring of the exception" seems to become a property of the project, somehow, and that's what I need. So I am set, so far. But knowing exactly where it is kept in the project, so I can revert it if needed, would be useful to know, though. Thanks. ---------------------------------------------------------------------- Martin_fr · 2012-08-19 13:30 Quote from: Elmug on August 19, 2012, 10:13:14 amThe resultant application no longer raises the exception, which is fine, because the exception happens within a DBgrid, when it was finding BCD data, and that data is OK. That is not possible. The "Ignore Exception" does not modify haw your program works. It only says if the debugger (if your progrom runs in the debugger) will tell you about it. If the debugger notifies you, it allows you to stop (actually this is "pause") your program. You can look at what happens, and then continue. If you do not stop/pause then your program continues right away. In all cases: - you paused, and continue - you did not pause, and continue - you set to "ignore", which is the same as continue In all cases your program will then see the exception and has to deal with it. For example in a try...except block. ---------------- The setting is saved globally. See environments menu > options. Section Debugger. There are pages that list the exceptions. ---------------------------------------------------------------------- Leledumbo · 2012-08-19 16:59 QuoteThat is not possible. The "Ignore Exception" does not modify haw your program works. It only says if the debugger (if your progrom runs in the debugger) will tell you about it.Perhaps it's an internal (expected and already handled) exception in the DBGrid, which is still caught by the debugger. That's why it doesn't appear in the real application. ---------------------------------------------------------------------- Elmug · 2012-08-19 17:29 Quote from: Martin_fr on August 19, 2012, 03:30:56 pmQuote from: Elmug on August 19, 2012, 10:13:14 amThe resultant application no longer raises the exception, which is fine, because the exception happens within a DBgrid, when it was finding BCD data, and that data is OK. That is not possible. The "Ignore Exception" does not modify haw your program works. It only says if the debugger (if your progrom runs in the debugger) will tell you about it. If the debugger notifies you, it allows you to stop (actually this is "pause") your program. You can look at what happens, and then continue. If you do not stop/pause then your program continues right away. In all cases: - you paused, and continue - you did not pause, and continue - you set to "ignore", which is the same as continue In all cases your program will then see the exception and has to deal with it. For example in a try...except block. ---------------- The setting is saved globally. See environments menu > options. Section Debugger. There are pages that list the exceptions. Not really. It did change how the .exe works. It no longer raises the exception, with the same database, and having made no changes at all to any cell. It seems to me that it puts some type of metacommand option (or whatever the terminology) in the project, so that the exception type is ignored by the resultant application. Unless you have documentation that supports what you state, I don't agree, for my case here. Thanks. ---------------------------------------------------------------------- BigChimp · 2012-08-20 06:59 QuoteUnless you have documentation that supports what you state, I don't agree, for my case here. Please show the documentation that supports what you state. Unless you show that, I don't believe you are right. I'd also apply Occam's razor to this question: a lot of your threads include your telling various other people they're wrong. Who is wrong, they or you? ---------------------------------------------------------------------- Martin_fr · 2012-08-20 12:59 Quote from: BigChimp on August 20, 2012, 08:59:24 amQuoteUnless you have documentation that supports what you state, I don't agree, for my case here. Please show the documentation that supports what you state. Unless you show that, I don't believe you are right. Actually: about the effects of the "Ignore this type of exception". I am the current maintainer of that bit of code. So I am rather sure about what it does. http://wiki.lazarus.freepascal.org/IDE_Window:_Debugger_Options#Langua ge_Exceptions QuotePrograms can raise exceptions. For example, when a file can not be read. Here you setup, if the debugger should stop on an exception. As I said: - It does not change the fact that the exception is happening - It only changes if the debugger will tell you Exceptions are something normal to happen (despite, it is not what the name suggests). If you use code from packages, then there may be many exceptions, that are intended, and handled. But for what you need, in this case it is the right thing to "ignore" it. Because (if) this exception is part of the package and dealt with, and you need not worry about it.