You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Lars Trieloff <la...@trieloff.net> on 2007/12/14 18:10:08 UTC

Re: scriptable error handling (was: Chickens, eggs and stars)

I think this is the best proposal,

put the 404.esp (or 401.esp or 500.esp for this purpose) into the  
content tree, and all matching errors will look for a script ascending  
the content tree. If nothing can be found, the default servlet kicks  
in and shows a plain error message.

regards,

Lars

On 13.12.2007, at 16:26, pih@wasabicowboy.com wrote:

> Could the system look up the tree from the requested resource for  
> the error script? If no error script is found in the tree it could  
> look for one in a default location. For example, if a request is  
> made for
>
> /a/b/c/foo.html
>
> Which results in a 404 the system would look in
>
> /a/b/c
> /a/b
> /a
> /error
>
> For 404.esp
>
> WDYT?
>
> Paddy
> Sent via BlackBerry from T-Mobile
>
> -----Original Message-----
> From: "Bertrand Delacretaz" <bd...@apache.org>
>
> Date: Thu, 13 Dec 2007 13:58:40
> To:sling-dev@incubator.apache.org
> Subject: Re: Chickens, eggs and stars
>
>
> On Dec 12, 2007 5:52 PM, Michael Marth <mm...@day.com> wrote:
>> Re issue 1):
>>
>> we could have a 404 handler script that kicks in when a non-existing
>> resource is requested....
>
> Good idea. Do you have a suggestion about how to select which 404  
> script to use?
>
> Assume I have dropped some scripts under /apps/foo, and I request
> /content/foo which does not exist.
>
> IIUC you'd want in this case to use the /apps/foo/status.404.esp
> script to handle this error, but how do we decide that this script is
> more appropriate than, say, /bar/somewhere/404.esp?
>
> We might say that we replace the first level of the pathname (/content
> in this case) with /apps, and use that as a starting point to look for
> scripts. That's a simple enough rule, but it's a bit constraining.
>
> -Bertrand

--
Lars Trieloff
lars@trieloff.net
http://weblogs.goshaky.com/weblogs/lars


Re: scriptable error handling (was: Chickens, eggs and stars)

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Dec 17, 2007 5:39 PM,  <pi...@wasabicowboy.com> wrote:
> ...That is what I was thinking as well. I'll make a JIRA ticket?..

Sure, feel free to do that!
-Bertrand


> -----Original Message-----
> From: "Bertrand Delacretaz" <bd...@apache.org>
>
> Date: Mon, 17 Dec 2007 16:14:48
> To:sling-dev@incubator.apache.org
> Subject: Re: scriptable error handling (was: Chickens, eggs and stars)
>
>
>
> On Dec 17, 2007 3:35 PM, Lars Trieloff <la...@trieloff.net> wrote:
> > ...Sorry no, by content tree I meant the part of the repository that is
> > used to store scripts, not the actual content. It can be confusing
> > when everything is content....
>
> Ok, agree then!
>
> > ...So the idea is to put the 404.js right next to the html.js. If I
> > request something.xhtml, 404.js will be excecuted. Similarily put the
> > 500.js right next to the POST.js, if something goes wrong in POST.js,
> > 500.js will be used to render the error...
>
> sounds good.
>
> -Bertrand
>



-- 
  Bertrand Delacretaz
  http://www.codeconsult.ch

Re: scriptable error handling (was: Chickens, eggs and stars)

Posted by pi...@wasabicowboy.com.
That is what I was thinking as well. I'll make a JIRA ticket?

Paddy
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: "Bertrand Delacretaz" <bd...@apache.org>

Date: Mon, 17 Dec 2007 16:14:48 
To:sling-dev@incubator.apache.org
Subject: Re: scriptable error handling (was: Chickens, eggs and stars)


On Dec 17, 2007 3:35 PM, Lars Trieloff <la...@trieloff.net> wrote:
> ...Sorry no, by content tree I meant the part of the repository that is
> used to store scripts, not the actual content. It can be confusing
> when everything is content....

Ok, agree then!

> ...So the idea is to put the 404.js right next to the html.js. If I
> request something.xhtml, 404.js will be excecuted. Similarily put the
> 500.js right next to the POST.js, if something goes wrong in POST.js,
> 500.js will be used to render the error...

sounds good.

-Bertrand

Re: scriptable error handling (was: Chickens, eggs and stars)

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Dec 17, 2007 3:35 PM, Lars Trieloff <la...@trieloff.net> wrote:
> ...Sorry no, by content tree I meant the part of the repository that is
> used to store scripts, not the actual content. It can be confusing
> when everything is content....

Ok, agree then!

> ...So the idea is to put the 404.js right next to the html.js. If I
> request something.xhtml, 404.js will be excecuted. Similarily put the
> 500.js right next to the POST.js, if something goes wrong in POST.js,
> 500.js will be used to render the error...

sounds good.

-Bertrand

Re: scriptable error handling (was: Chickens, eggs and stars)

Posted by Lars Trieloff <la...@trieloff.net>.
Sorry no, by content tree I meant the part of the repository that is  
used to store scripts, not the actual content. It can be confusing  
when everything is content.

So the idea is to put the 404.js right next to the html.js. If I  
request something.xhtml, 404.js will be excecuted. Similarily put the  
500.js right next to the POST.js, if something goes wrong in POST.js,  
500.js will be used to render the error.

Lars



On 17.12.2007, at 09:52, Bertrand Delacretaz wrote:

> On Dec 14, 2007 6:10 PM, Lars Trieloff <la...@trieloff.net> wrote:
>> ...I think this is the best proposal,
>>
>> put the 404.esp (or 401.esp or 500.esp for this purpose) into the
>> content tree, and all matching errors will look for a script  
>> ascending
>> the content tree. If nothing can be found, the default servlet kicks
>> in and shows a plain error message....
>
> Sounds reasonable, but currently scripts and content are well
> separated...this would introduce "programming stuff" in the content,
> which I don't like too much. But I don't have a better proposal at
> this time...
>
> -Bertrand
>
>>
>> regards,
>>
>> Lars
>>
>> On 13.12.2007, at 16:26, pih@wasabicowboy.com wrote:
>>
>>> Could the system look up the tree from the requested resource for
>>> the error script? If no error script is found in the tree it could
>>> look for one in a default location. For example, if a request is
>>> made for
>>>
>>> /a/b/c/foo.html
>>>
>>> Which results in a 404 the system would look in
>>>
>>> /a/b/c
>>> /a/b
>>> /a
>>> /error
>>>
>>> For 404.esp
>>>
>>> WDYT?
>>>
>>> Paddy
>>> Sent via BlackBerry from T-Mobile
>>>
>>> -----Original Message-----
>>> From: "Bertrand Delacretaz" <bd...@apache.org>
>>>
>>> Date: Thu, 13 Dec 2007 13:58:40
>>> To:sling-dev@incubator.apache.org
>>> Subject: Re: Chickens, eggs and stars
>>>
>>>
>>> On Dec 12, 2007 5:52 PM, Michael Marth <mm...@day.com> wrote:
>>>> Re issue 1):
>>>>
>>>> we could have a 404 handler script that kicks in when a non- 
>>>> existing
>>>> resource is requested....
>>>
>>> Good idea. Do you have a suggestion about how to select which 404
>>> script to use?
>>>
>>> Assume I have dropped some scripts under /apps/foo, and I request
>>> /content/foo which does not exist.
>>>
>>> IIUC you'd want in this case to use the /apps/foo/status.404.esp
>>> script to handle this error, but how do we decide that this script  
>>> is
>>> more appropriate than, say, /bar/somewhere/404.esp?
>>>
>>> We might say that we replace the first level of the pathname (/ 
>>> content
>>> in this case) with /apps, and use that as a starting point to look  
>>> for
>>> scripts. That's a simple enough rule, but it's a bit constraining.
>>>
>>> -Bertrand
>>
>> --
>> Lars Trieloff
>> lars@trieloff.net
>> http://weblogs.goshaky.com/weblogs/lars
>>
>>
>
>
>
> -- 
>  Bertrand Delacretaz
>  http://www.codeconsult.ch

--
Lars Trieloff
lars@trieloff.net
http://weblogs.goshaky.com/weblogs/lars


Re: scriptable error handling (was: Chickens, eggs and stars)

Posted by pi...@wasabicowboy.com.
One could walk the resource type tree as well this would keep the content and scripts in different trees.

Paddy
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: "Bertrand Delacretaz" <bd...@apache.org>

Date: Mon, 17 Dec 2007 09:52:22 
To:sling-dev@incubator.apache.org
Subject: Re: scriptable error handling (was: Chickens, eggs and stars)


On Dec 14, 2007 6:10 PM, Lars Trieloff <la...@trieloff.net> wrote:
> ...I think this is the best proposal,
>
> put the 404.esp (or 401.esp or 500.esp for this purpose) into the
> content tree, and all matching errors will look for a script ascending
> the content tree. If nothing can be found, the default servlet kicks
> in and shows a plain error message....

Sounds reasonable, but currently scripts and content are well
separated...this would introduce "programming stuff" in the content,
which I don't like too much. But I don't have a better proposal at
this time...

-Bertrand

>
> regards,
>
> Lars
>
> On 13.12.2007, at 16:26, pih@wasabicowboy.com wrote:
>
> > Could the system look up the tree from the requested resource for
> > the error script? If no error script is found in the tree it could
> > look for one in a default location. For example, if a request is
> > made for
> >
> > /a/b/c/foo.html
> >
> > Which results in a 404 the system would look in
> >
> > /a/b/c
> > /a/b
> > /a
> > /error
> >
> > For 404.esp
> >
> > WDYT?
> >
> > Paddy
> > Sent via BlackBerry from T-Mobile
> >
> > -----Original Message-----
> > From: "Bertrand Delacretaz" <bd...@apache.org>
> >
> > Date: Thu, 13 Dec 2007 13:58:40
> > To:sling-dev@incubator.apache.org
> > Subject: Re: Chickens, eggs and stars
> >
> >
> > On Dec 12, 2007 5:52 PM, Michael Marth <mm...@day.com> wrote:
> >> Re issue 1):
> >>
> >> we could have a 404 handler script that kicks in when a non-existing
> >> resource is requested....
> >
> > Good idea. Do you have a suggestion about how to select which 404
> > script to use?
> >
> > Assume I have dropped some scripts under /apps/foo, and I request
> > /content/foo which does not exist.
> >
> > IIUC you'd want in this case to use the /apps/foo/status.404.esp
> > script to handle this error, but how do we decide that this script is
> > more appropriate than, say, /bar/somewhere/404.esp?
> >
> > We might say that we replace the first level of the pathname (/content
> > in this case) with /apps, and use that as a starting point to look for
> > scripts. That's a simple enough rule, but it's a bit constraining.
> >
> > -Bertrand
>
> --
> Lars Trieloff
> lars@trieloff.net
> http://weblogs.goshaky.com/weblogs/lars
>
>



-- 
  Bertrand Delacretaz
  http://www.codeconsult.ch

Re: scriptable error handling (was: Chickens, eggs and stars)

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Dec 14, 2007 6:10 PM, Lars Trieloff <la...@trieloff.net> wrote:
> ...I think this is the best proposal,
>
> put the 404.esp (or 401.esp or 500.esp for this purpose) into the
> content tree, and all matching errors will look for a script ascending
> the content tree. If nothing can be found, the default servlet kicks
> in and shows a plain error message....

Sounds reasonable, but currently scripts and content are well
separated...this would introduce "programming stuff" in the content,
which I don't like too much. But I don't have a better proposal at
this time...

-Bertrand

>
> regards,
>
> Lars
>
> On 13.12.2007, at 16:26, pih@wasabicowboy.com wrote:
>
> > Could the system look up the tree from the requested resource for
> > the error script? If no error script is found in the tree it could
> > look for one in a default location. For example, if a request is
> > made for
> >
> > /a/b/c/foo.html
> >
> > Which results in a 404 the system would look in
> >
> > /a/b/c
> > /a/b
> > /a
> > /error
> >
> > For 404.esp
> >
> > WDYT?
> >
> > Paddy
> > Sent via BlackBerry from T-Mobile
> >
> > -----Original Message-----
> > From: "Bertrand Delacretaz" <bd...@apache.org>
> >
> > Date: Thu, 13 Dec 2007 13:58:40
> > To:sling-dev@incubator.apache.org
> > Subject: Re: Chickens, eggs and stars
> >
> >
> > On Dec 12, 2007 5:52 PM, Michael Marth <mm...@day.com> wrote:
> >> Re issue 1):
> >>
> >> we could have a 404 handler script that kicks in when a non-existing
> >> resource is requested....
> >
> > Good idea. Do you have a suggestion about how to select which 404
> > script to use?
> >
> > Assume I have dropped some scripts under /apps/foo, and I request
> > /content/foo which does not exist.
> >
> > IIUC you'd want in this case to use the /apps/foo/status.404.esp
> > script to handle this error, but how do we decide that this script is
> > more appropriate than, say, /bar/somewhere/404.esp?
> >
> > We might say that we replace the first level of the pathname (/content
> > in this case) with /apps, and use that as a starting point to look for
> > scripts. That's a simple enough rule, but it's a bit constraining.
> >
> > -Bertrand
>
> --
> Lars Trieloff
> lars@trieloff.net
> http://weblogs.goshaky.com/weblogs/lars
>
>



-- 
  Bertrand Delacretaz
  http://www.codeconsult.ch