Re: Standardized Euphoria -> Debug and Error Handling
- Posted by Chris Bensler <bensler at nt.net> Jan 13, 2007
- 506 views
Pete Lomax wrote: > > Chris Bensler wrote: > > The only problem here is that the applications halt within the fatal_error > > routine and the ex.err traceback has to be followed out of the error > > branch. > In Positive I added "without debug" to avoid that issue. > Fairly obviously, you need to be pretty certain the code is completely > bug-free > before slapping that in as you will otherwise struggle to debug it! > When set, it just inhibits emit of opLnt (=OPSTARTLINE & DISPLAY_VAR?) and > sets a bit on any routines added to symtab, for the ex.err create routine. > Like other with/without options, the setting is restored at eof. Interesting idea. I think we can accomplish the same thing by editing ex.err using crash_routine(), but I'm sure it will be tedious. If a routine or bit of code is within a 'without debug' scope. What happens when errors do occur within that code segment? > I just quickly skimmed your code and it looks pretty good. Thank you. Please try it though. One thing that may be contentious is the customizable error() routine. It will allow an existing custom error routine to be overrided with a new one. Of course the best way would be to have the new routine call the old one, creating a chain but it doesn't always work out the best. Preferably, it would be better if we could simply redefine the error() routine itself. That way the previous definition could be still used for code that is outside the scope of the new definition. It's still extremely useful. The exception system can be used when scope is required. Chris Bensler ~ The difference between ordinary and extraordinary is that little extra ~ http://empire.iwireweb.com - Empire for Euphoria