[Laszlo-dev] PLEASE use the formatting directives

P T Withington ptw at pobox.com
Tue Dec 1 12:19:22 PST 2009


If you say this:

> catch (error:Error) {
>            if ($debug) Debug.warn(event.type + " " + error);

You turn the error into a string, which means you have no way to get your hands on the error (say, to inspect it, or to ask it for a stack trace in runtimes that support that).

Please use the built-in formatting tools if you need to format your warnings or errors, so that the objects behind them are preserved for inspection.  Something like this would be much more informative.

> catch (error:Error) {
>            if ($debug) Debug.warn("loaderEventHandler: %w",  error);





More information about the Laszlo-dev mailing list