[Helma-user] more server side js
Chris Zumbrunn
chris at zumbrunn.com
Fri Dec 14 18:18:08 CET 2007
On Dec 14, 2007, at 17:45 , Aaron Iba wrote:
>> On Dec 14, 2007, at 8:59 , Juerg Lehni wrote:
>>
>>> And then also, on their own site, there was a time when Helma errors
>>> appeared:
>>>
>>> Macro error in this.guideExample: ReferenceError: "hcl" is not
>>> defined. (/appjet/live/helma-1.6.0/../frontend/helma_apps/appjet/
>>> code/
>>> Global/global_functions.js#250)]
>
> Oops! Incidentally, what's the right way to catch and log macro
> errors like this?
Javascript errors you can catch using an error action. For that,
"error" is the default action name, but you can override it by
specifying an error property in your server.properties or
app.properties file.
http://helma.org/docs/guide/properties/listall/
For catching undefined macros, there is also an event that you can
catch by defining an onUnhandledMacro function.
http://helma.zumbrunn.net/reference/global.html#onUnhandledMacro
>> I don't particularly like the way they did it. Smell to much like PHP
>> for my taste. However, that might exactly be what is needed to give
>> it
>> the killer app appeal. At the very least, this could help plow the
>> way
>> for something more elegant, if anything.
>
> The php smell probably comes from our design requirement that you be
> able to write an entire app in 1 file of code. We can probably all
> agree that this breaks down as a project gets really big. (The appjet
> frontend itself would probably not fit very nicely into 1 file of
> code). But for small apps, I think it's a good fit.
Of course, yes. One could even come up with coding conventions that
would allow for an MVC type separation of the code within that single
file. In that sense, writing an AppJet web app is a bit like writing a
helma app that consists only of a single action.
Chris
More information about the Helma-user
mailing list