[quote=402979:@Jeff Tullin]When in debug mode, append a log to a global array of strings.
That wont be dead even in an unhandled exception.[/quote]
This would work, but I’d have to reset it either at the end of each function, or when it returns early, or at the start of each function.
For example
checkPoint = "1"
doSomethings
if thangFailed then return nil // --- Returns early as there's no point in continuing.
checkPoint = "7"
doSomeMoreThings
if thingINeed = nil then return nil // --- Returns early as there's no point in continuing.
checkPoint = "13"
doABunchMoreStuff
if thatSomething = smellsLikeFish then return nil // --- Returns early as there's no point in continuing.
// --- All finished.
checkPoint = ""
return result
I am basically trying to implement a fit and forget solution, one that doesn’t require a lot of code and checking to make sure it’s reporting the correct checkpoint. What I want to be sure of, is that when the method is exited the checkPoint is cleared. Sure I could go through every opportunity to exit early and make sure that it’s reset there, but I can’t be sure that I won’t miss one.