Hi, Martin.
There currently isn't a way to do this. Nicholas Perez has been
working on a patch for out-of-band Filter messaging, however. He
seems close to being finished, too. Given this, it should be easier
to report failures within Stackable.
Meanwhile, you can use Filter::Line in Client::TCP, and in your input
handler pass the lines through Filter::JSON yourself. It's more
work, but it will do what you need until better filter exceptions
come along.
Oh, and this might actually be your long-term solution depending on
how Filter::JSON deals with invalid data. If it remains in the
filter buffer, then the filter becomes stuck. To move on, you may
need to destroy the stuck filter and create a new one.
--
Rocco Caputo - [EMAIL PROTECTED]
On Oct 11, 2007, at 12:06, Martin Evans wrote:
Hi,
I want to catch errors from a filter and cannot see how to go about
it. My stacked filter contains Filter::Line, and Filter::JSON and
they are attached to ClientFilter in POE::Component::Server::TCP.
When invalid JSON arrives I get something like:
Couldn't convert json to object: 'false' expected, at character
offset 0 ["fred\r"] at /usr/lib/perl5/site_perl/5.8.8/JSON/Any.pm
line 102.
appearing on my terminal.
I have seen the thread "Filter error reporting" back in August but
could not find a resolution. Is there any way to handle errors from
Filter::JSON in this scenario?
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com