Should runtime error be showing when in release?

BlitzMax Forums/BlitzMax Programming/Should runtime error be showing when in release?

Perturbatio(Posted 2005) [#1]
because this doesn't show for me (although it still works).

Graphics 640,480,0,0
OnEnd(Cleanup)

Print "doing error"
If True Then RuntimeError("error!  oh no!")
Print "done error, should never print this" 'and doesn't
WaitKey()

Function cleanup()
	Print "cleanup"
End Function



Stuart Morgan(Posted 2005) [#2]
Dont know if this is a bug or not or whether mark intended it to work this way, I feel it needs to be changed so it shows the error for debug and release, otherwise it could confuse users of your programs.

I guess you could use notify and confirm as they show in release apps?


Perturbatio(Posted 2005) [#3]
thing is, even in release it will print the error when using it as a console app.


Stuart Morgan(Posted 2005) [#4]
thing is, even in release it will print the error when using it as a console app.

Oh yeah, I didn't notice that.

I usually create my own custom error notification system for some of my larger projects something like this...



Anyway thats beside the point, RuntimeError *should* work in release.

Note: That example is basically replicating RuntimeError.


Perturbatio(Posted 2005) [#5]
yeah, I had considered that approach, but then I thought that I shouldn't need to. I'm gonna bug it.


Dreamora(Posted 2005) [#6]
The error approach is not bad ... But I would suggest using try - catch - throw to make sure that real bugs are catched as well, not only "prethought" bugs ;)


ziggy(Posted 2005) [#7]
there should be a 'onerror' the same way there's a 'onend'. This would be the only safe way to handle errors. If there's no OnError function assigned, it could make the standar error notification. And, it could clear the OnError function, before calling it, if an error happens, in order to show the standar error handling in case an error occurs inside the 'onError' function.

I don't know if I should pot this somewhere else...


Perturbatio(Posted 2005) [#8]
The error approach is not bad ... But I would suggest using try - catch - throw to make sure that real bugs are catched as well, not only "prethought" bugs ;)


This was not an example of error catching, merely something to demonstrate Runtimerror was not being displayed.
The OnEnd was there because I was curious as to whether it would still call that or not. It does.


GW(Posted 2005) [#9]
I asked this question a while back and never got a clear answer then either. I eventually resorted to overloading the runtime error function with my own that works the same in release and debug.


N(Posted 2005) [#10]
RuntimeError is meant to show an error regardless of build mode. Works the same way in BlitzPlus and Blitz3D.

The idea is that if your application shows a runtime error, it should have information that a user or tester can send to you, because the error really shouldn't occur in the first place unless something went wrong or someone did something stupid.

That's my take on it, anywho.