metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cestella <...@git.apache.org>
Subject [GitHub] incubator-metron pull request #333: METRON-249: Field Transformation functio...
Date Mon, 31 Oct 2016 20:20:52 GMT
Github user cestella commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/333#discussion_r85824225
  
    --- Diff: metron-platform/metron-common/src/main/java/org/apache/metron/common/dsl/functions/NetworkFunctions.java
---
    @@ -232,10 +237,15 @@ private static URL toUrl(Object urlObj) {
         if(urlObj == null) {
           return null;
         }
    -    try {
    -      return new URL(urlObj.toString());
    -    } catch (MalformedURLException e) {
    -      return null;
    +    if(urlObj instanceof String) {
    +      try {
    +        return new URL(urlObj.toString());
    +      } catch (MalformedURLException e) {
    --- End diff --
    
    I'm treating a distinction here between a type or syntactic error which is likely a configuration
error and should be immediately percolated up versus a semantic error (the data is malformed,
but still of the proper type) which should be allowed to pass.  It's not necessarily an error.
 You could have a source which contains a `url` field which is not populated or populated
with a default value, so you'd expect the processed fields to also be null.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message