Re: Handling errors retrieving a for

2016-08-24 Thread Javier Puerto
2016-08-21 18:38 GMT+02:00 Christopher Schultz :

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Javier
>
> On 6/1/16 3:19 PM, Javier Puerto wrote:
> > Hi Christopher,
> >
> > I more used to version 2.2 but it should be the same. By you
> > description I think about creating a new pipeline with a matcher to
> > handle the external request with a specific error handler[1] that
> > contains a reader with an empty file.
> >
> > It should be something like:
> >
> > 
> >
> >   > src="http://remote-server/{1}"/> 
> >
> >  
> > 
> >
> > 
> >
> > Then you could substitute all your calls to external resources
> > that needs to produce an empty XML in case of error to call to the
> > new matcher. This way you can tune up the external pipeline for
> > caching if it's needed.
>
> I tried:
>
> 
>   
> 
>   
>   
> 
> 
> 
>   
>   
> 
>   
> 
>
> When I get a "no route to host" error from the unavailable-resource, I
> get the standard Cocoon error page with a stack trace. I would have
> expected the  from the unavailable resource to simply
> provide no content to aggregate with the other sources.
>

The exception will be handled at pipeline level so if the source fails, the
handle-errors that you defined will be triggered.


>
> Do I need a more complicated handle-errors section? All of the
> examples in the docs have a  in them to check the
> exception type.
>

The problem is that you want that your resources return an empty content in
case that the application can not get the data in the middle of the
process. So you need to declare another pipeline with a matcher that will
accept any URL and retrieves it for you, this matcher will have the
"handle-errors" tag that will read an empty XML file.

Create a new pipeline like I send previously and just call the resources in
the aggregator to resolve the internal pipeline.

  
  
  


Notice the protocol and the internal pipeline matcher path preffix. You
should get what you expect with this change.


> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXudkCAAoJEBzwKT+lPKRY5NIP/2j5npsvm4VZEXDkCPYDrZCv
> Zk8mfShffDkf0Xh1lOUnbXiwezv3YkQIq7gRa1rhWnR69lriAJQku1vsSsnagADH
> Re4BzJXxWhJ8a+x7Hv8Ibhvjzl53qxxVl9U/cop8R4u9tQAH4aVWPaLUrkxtnFGh
> 0G+MEnOr8x62NG1RHSVuhNfXgFTxVaXDkxcS3w47Vq/Ts+ulU7Hm0XXfPUJB5XG/
> /sREax46fY0/9Qweb82QbG5CHaI22Uv/xnxq4t+HHA1I3DJtZDpiHHcueF02Hn5R
> LtRq4gDvYqAriGSy31W+roNCT+ItT2yThQ9EdcRg4Dc2meN/0s7jTdbIhF1YU2ut
> GjfW1504z5GoPYO1kaS5pSFH5zIaOaKUp3SYCHrkCAhEY5u5u10NIqleHUnj8g6z
> latO8gp26UgdlBMZwaVXc2TOIX3BbKhZTveEjwc9wCd1EyrrryoLr6xT5hKUctaf
> u1oGOaQcgHVNAskztwDNAYzyeep+lRAIPPGQ1irhXrPA66nOuyHW6+I4EBiboQ8J
> RUi0djAUZg/srOxpWvC5ww+FyGleH+a0bJe3qz6BhSPVqy+VddjUl4SnqeT+1m6t
> yU/K+q8i3TPGHGDJwDQeGqkesB5e3okT9UJuj2SqOMOQ7yHe0aR0JOepP4Y9oNuI
> sTgQuM/AzAsTpO60ML1v
> =ewdz
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: Handling errors retrieving a for

2016-08-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Javier

On 6/1/16 3:19 PM, Javier Puerto wrote:
> Hi Christopher,
> 
> I more used to version 2.2 but it should be the same. By you
> description I think about creating a new pipeline with a matcher to
> handle the external request with a specific error handler[1] that
> contains a reader with an empty file.
> 
> It should be something like:
> 
> 
> 
>   src="http://remote-server/{1}"/> 
> 
>   
> 
> 
> 
> 
> Then you could substitute all your calls to external resources
> that needs to produce an empty XML in case of error to call to the
> new matcher. This way you can tune up the external pipeline for
> caching if it's needed.

I tried:


  

  
  



  
  

  


When I get a "no route to host" error from the unavailable-resource, I
get the standard Cocoon error page with a stack trace. I would have
expected the  from the unavailable resource to simply
provide no content to aggregate with the other sources.

Do I need a more complicated handle-errors section? All of the
examples in the docs have a  in them to check the
exception type.

Thanks,
- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXudkCAAoJEBzwKT+lPKRY5NIP/2j5npsvm4VZEXDkCPYDrZCv
Zk8mfShffDkf0Xh1lOUnbXiwezv3YkQIq7gRa1rhWnR69lriAJQku1vsSsnagADH
Re4BzJXxWhJ8a+x7Hv8Ibhvjzl53qxxVl9U/cop8R4u9tQAH4aVWPaLUrkxtnFGh
0G+MEnOr8x62NG1RHSVuhNfXgFTxVaXDkxcS3w47Vq/Ts+ulU7Hm0XXfPUJB5XG/
/sREax46fY0/9Qweb82QbG5CHaI22Uv/xnxq4t+HHA1I3DJtZDpiHHcueF02Hn5R
LtRq4gDvYqAriGSy31W+roNCT+ItT2yThQ9EdcRg4Dc2meN/0s7jTdbIhF1YU2ut
GjfW1504z5GoPYO1kaS5pSFH5zIaOaKUp3SYCHrkCAhEY5u5u10NIqleHUnj8g6z
latO8gp26UgdlBMZwaVXc2TOIX3BbKhZTveEjwc9wCd1EyrrryoLr6xT5hKUctaf
u1oGOaQcgHVNAskztwDNAYzyeep+lRAIPPGQ1irhXrPA66nOuyHW6+I4EBiboQ8J
RUi0djAUZg/srOxpWvC5ww+FyGleH+a0bJe3qz6BhSPVqy+VddjUl4SnqeT+1m6t
yU/K+q8i3TPGHGDJwDQeGqkesB5e3okT9UJuj2SqOMOQ7yHe0aR0JOepP4Y9oNuI
sTgQuM/AzAsTpO60ML1v
=ewdz
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Handling errors retrieving a for

2016-06-02 Thread Javier Puerto
2016-06-02 15:35 GMT+02:00 Christopher Schultz :

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Javier,
>
> On 6/1/16 3:19 PM, Javier Puerto wrote:
> > I more used to version 2.2 but it should be the same. By you
> > description I think about creating a new pipeline with a matcher to
> > handle the external request with a specific error handler[1] that
> > contains a reader with an empty file.
> >
> > It should be something like:
> >
> > 
> >
> >   > src="http://remote-server/{1}"/> 
> >
> >  
> > 
> >
> > 
> >
> > Then you could substitute all your calls to external resources
> > that needs to produce an empty XML in case of error to call to the
> > new matcher. This way you can tune up the external pipeline for
> > caching if it's needed.
> >
> > I hope it helps.
>
> Thanks.
>
> How can I reference a matcher from a different pipeline? Do I need to
> address it any differently than I would if the matcher were in the
> same pipeline?
>

An example is better: http://wiki.apache.org/cocoon/CocoonProtocolExample


>
> Speaking of caching, I'd prefer for the "remote-handler" matcher to
> re-try pretty regularly. Do matchers cache at all under normal
> circumstances? I've never bothered attempting to configure any caching
> in Cocoon before.
>

You should configure the pipeline as "noncaching". There are more details
at:
https://cocoon.apache.org/2.1/userdocs/concepts/caching.html

Salu2.


>
> Thanks,
> - -chris
>
> > 2016-06-01 19:56 GMT+02:00 Christopher Schultz
> >  > >:
> >
> > All,
> >
> > Using Cocoon 2.1, I've got an aggregate generator like this:
> >
> >  
> >   > src="http://remote-server/baz.xml; />  ...
> > 
> >
> > There are times when "remote-server" is not available and I'd like
> > to basically include nothing at that location within the aggregate
> > document .
> >
> > Can I do that within the  or  elements, or
> > is it better to wrap the  another  with an
> > error handled?
> >
> > Followup question: how can I configure an error handler to do
> > whatever I want? I only want this particular behavior to happen for
> > this particular  ... presumably, I'll want other behavior
> > in other situations.
> >
> > Thanks, -chris
> >
> > -
> >
> >
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> >  For additional
> > commands, e-mail: users-h...@cocoon.apache.org
> > 
> >
> >
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXUDY/AAoJEBzwKT+lPKRY7TcP/jxbYNldkn7MFFwKKR9SYtEd
> Ow6XBZ/dTyXhrcSWz9lyOulZ2/WqHpar7S1jwPmYSx+Ga9FOlWghU+5CYI3Ohovi
> R+v44GTLaydwp2QnqG7sEXl3l2UxY83pzGl/1ae5M5BTULPdkM8LTRNl1U1bssAC
> W2BY2ScSv5g8psLLc7dKOCfY7QQqwz84M6YVzorLsUJ96NETvuKn2yvWoYYs+iuX
> LZrFTRWDwbWxedm5fArFoNYd1uYgslvc4Ua7sZbv3qLimy8ms1h61vABbI/bUcwM
> M2JxXIgOAsMc7MGVuw5jjZQOSvg7S/8H/QUPQ+BflXlEBkaZNnz0RFN7wTGgEjVl
> fzdyY9FF9QxVQysfyaFquJqZCbvIRy1c7vpzpG5B3NXVm92ZFrfVgOr1vFb4tcY2
> nR7FQoCZ2ZuHtNcPgyNhk2MpHtjkj14mFq0jIyxzRu/A6Ltd//pyw7cGosP7xzFn
> +12KdigPK45nSRo7TOlSxv7RZ7FfYFwOj2UeXP/5xPoaWom5PoYemzSn7HULr4NM
> MSX7v02Ndb0ZBKEn7O1YOLdQmaQTYGnTPP7zhJ2jaccHAxz5RmbjWR2r0EE3MtdO
> 6Gu2KC/PqiIJF3qM6l/xcLHRRSilh+Xl/qu/0cUIGbzWtgAfkkZAWP42DT/pzA/o
> I0gdBU+WWcqZaPCEFYcf
> =89az
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: Handling errors retrieving a for

2016-06-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Javier,

On 6/1/16 3:19 PM, Javier Puerto wrote:
> I more used to version 2.2 but it should be the same. By you
> description I think about creating a new pipeline with a matcher to
> handle the external request with a specific error handler[1] that
> contains a reader with an empty file.
> 
> It should be something like:
> 
> 
> 
>   src="http://remote-server/{1}"/> 
> 
>   
> 
> 
> 
> 
> Then you could substitute all your calls to external resources
> that needs to produce an empty XML in case of error to call to the
> new matcher. This way you can tune up the external pipeline for
> caching if it's needed.
> 
> I hope it helps.

Thanks.

How can I reference a matcher from a different pipeline? Do I need to
address it any differently than I would if the matcher were in the
same pipeline?

Speaking of caching, I'd prefer for the "remote-handler" matcher to
re-try pretty regularly. Do matchers cache at all under normal
circumstances? I've never bothered attempting to configure any caching
in Cocoon before.

Thanks,
- -chris

> 2016-06-01 19:56 GMT+02:00 Christopher Schultz 
>  >:
> 
> All,
> 
> Using Cocoon 2.1, I've got an aggregate generator like this:
> 
>   
>   src="http://remote-server/baz.xml; />  ... 
> 
> 
> There are times when "remote-server" is not available and I'd like
> to basically include nothing at that location within the aggregate
> document .
> 
> Can I do that within the  or  elements, or
> is it better to wrap the  another  with an
> error handled?
> 
> Followup question: how can I configure an error handler to do
> whatever I want? I only want this particular behavior to happen for
> this particular  ... presumably, I'll want other behavior
> in other situations.
> 
> Thanks, -chris
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
>  For additional
> commands, e-mail: users-h...@cocoon.apache.org 
> 
> 
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXUDY/AAoJEBzwKT+lPKRY7TcP/jxbYNldkn7MFFwKKR9SYtEd
Ow6XBZ/dTyXhrcSWz9lyOulZ2/WqHpar7S1jwPmYSx+Ga9FOlWghU+5CYI3Ohovi
R+v44GTLaydwp2QnqG7sEXl3l2UxY83pzGl/1ae5M5BTULPdkM8LTRNl1U1bssAC
W2BY2ScSv5g8psLLc7dKOCfY7QQqwz84M6YVzorLsUJ96NETvuKn2yvWoYYs+iuX
LZrFTRWDwbWxedm5fArFoNYd1uYgslvc4Ua7sZbv3qLimy8ms1h61vABbI/bUcwM
M2JxXIgOAsMc7MGVuw5jjZQOSvg7S/8H/QUPQ+BflXlEBkaZNnz0RFN7wTGgEjVl
fzdyY9FF9QxVQysfyaFquJqZCbvIRy1c7vpzpG5B3NXVm92ZFrfVgOr1vFb4tcY2
nR7FQoCZ2ZuHtNcPgyNhk2MpHtjkj14mFq0jIyxzRu/A6Ltd//pyw7cGosP7xzFn
+12KdigPK45nSRo7TOlSxv7RZ7FfYFwOj2UeXP/5xPoaWom5PoYemzSn7HULr4NM
MSX7v02Ndb0ZBKEn7O1YOLdQmaQTYGnTPP7zhJ2jaccHAxz5RmbjWR2r0EE3MtdO
6Gu2KC/PqiIJF3qM6l/xcLHRRSilh+Xl/qu/0cUIGbzWtgAfkkZAWP42DT/pzA/o
I0gdBU+WWcqZaPCEFYcf
=89az
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Handling errors retrieving a for

2016-06-01 Thread Javier Puerto
Hi Cristopher,

I more used to version 2.2 but it should be the same. By you description I
think about creating a new pipeline with a matcher to handle the external
request with a specific error handler[1] that contains a reader with an
empty file.

It should be something like:



  
http://remote-server/{1}"/>
  

  

  



Then you could substitute all your calls to external resources that needs
to produce an empty XML in case of error to call to the new matcher. This
way you can tune up the external pipeline for caching if it's needed.

I hope it helps.

Salu2.

[1]:
http://cocoon.apache.org/2.1/userdocs/concepts/errorhandling.html#Error+Handler+Hierarchy

2016-06-01 19:56 GMT+02:00 Christopher Schultz :

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> All,
>
> Using Cocoon 2.1, I've got an aggregate generator like this:
>
>   
> 
>   
>   http://remote-server/baz.xml; />
> 
> ...
>   
>
> There are times when "remote-server" is not available and I'd like to
> basically include nothing at that location within the aggregate document
> .
>
> Can I do that within the  or  elements, or is
> it better to wrap the  another  with an error
> handled?
>
> Followup question: how can I configure an error handler to do whatever
> I want? I only want this particular behavior to happen for this
> particular  ... presumably, I'll want other behavior in
> other situations.
>
> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAldPIeUACgkQ9CaO5/Lv0PBW7wCfZtyG7w8bcgOuVn80V4NZtxoy
> n10AnAtqYx0F2uHml7wbEPh4Bg9G3s3Y
> =aPSk
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Handling errors retrieving a for

2016-06-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

All,

Using Cocoon 2.1, I've got an aggregate generator like this:

  

  
  http://remote-server/baz.xml; />

...
  

There are times when "remote-server" is not available and I'd like to
basically include nothing at that location within the aggregate document
.

Can I do that within the  or  elements, or is
it better to wrap the  another  with an error
handled?

Followup question: how can I configure an error handler to do whatever
I want? I only want this particular behavior to happen for this
particular  ... presumably, I'll want other behavior in
other situations.

Thanks,
- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAldPIeUACgkQ9CaO5/Lv0PBW7wCfZtyG7w8bcgOuVn80V4NZtxoy
n10AnAtqYx0F2uHml7wbEPh4Bg9G3s3Y
=aPSk
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org