[DGD] About runtime errors

Robert Forshaw iouswuoibev at hotmail.com
Tue Jan 6 22:26:40 CET 2004


I examined Kernel's method of dealing with runtime errors, left feeling more 
confused than before and decided to write my own function by trial and 
error. This is what I've ended up with:

void runtime_error(string error, int caught, int ticks)
{
	mixed ** trace;
	mixed * err, err2;
	trace = call_trace();
	err = trace[sizeof(trace) - 2];
	err2 = trace[sizeof(trace) - 3];

	message("\nRuntime error in function " + err[2] +
		"()\nIn Program \"" + err[1] + "\" on line " + err[3] +
		",\nWhich was called by \"" + err2[1] + "\" via " +
		(err[4] ? "call_other()" : "inheritance") +
		"\nwithin function " +
		err2[2]  + "() on line " + err2[3] + ".\n");

}

This seems to produce the correct output. It always assumes that the last 
element of trace describes the current calling process, that would be 
runtime_error(), and before that the erronous function call, and before that 
the program and function which called the erronous function call. Is there 
any situation where this might not be the case? In other words, is this 
function fallable, or even downright incorrect...?

Could someone explain to me what a 'full stack trace' is exactly?  :)

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list