On 24/09/15 03:34, Andrea Aime wrote:
> On Wed, Sep 23, 2015 at 3:14 PM, Dünnebeil Gerhard <
> [email protected]> wrote:
>> But when it comes to a NULL-Value I get the error message
>> “formatDateTimezone: could not parse date: null”.
> Hum... this message is there on purpose, this is the code:
>          Date date = parameters.get(1).evaluate(object, Date.class);
>          if (date == null) {
>              throw new RuntimeException(getName() + ": could not parse date:
> "
>                      + (String) parameters.get(1).evaluate(object,
> String.class));
>          }
> Imho this is excessive, it should return a empty string instead...

But this would cause genuine failures to be silenced.

Would it not be better to add an additional top-level guard so that when 
object is null, null is returned? This would separate error handling 
from null pass-through, and be consistent with the behaviour of filter 
functions like centroid.

Is there ever a benefit to using an empty string? The encoder should 
just ignore elements with null content.

Kind regards,

-- 
Ben Caradoc-Davies <[email protected]>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to