Prev | Current Page 380 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

In order to provide actual information collected by the virtual machine, you need to add a few
more functions.
public function getSource() : String
{
var src : String = ???File: ??? + __infos.fileName + ??? | Line: ??? + ?¬
__infos.lineNumber + ???\n???;
src += ???In method ??? + __infos.methodName + ??? of class ??? + ?¬
__infos.className;
return src;
}
This function caters for the second of the two constructor parameters, the haxe.PosInfos object, as
normally provided by the virtual machine itself. This should now cover 90 percent of the exception class
needs. However, you should also include stack trace information when available.
Debug Level Functionality
You probably won ??™ t want to release software compiled with the - debug flag. For one, it exposes
information about your application that you otherwise wouldn ??™ t want exposed, while at the same time,
it bloats your application slightly with extra code. However, none of this will matter when debugging
your application, so any added functionality, however small, could be code well implemented.


Pages:
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392