[ 
https://issues.apache.org/jira/browse/BEAM-5141?focusedWorklogId=134729&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-134729
 ]

ASF GitHub Bot logged work on BEAM-5141:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Aug/18 21:07
            Start Date: 14/Aug/18 21:07
    Worklog Time Spent: 10m 
      Work Description: akedin commented on a change in pull request #6216: 
[BEAM-5141] Improve error message when SET unregistered options
URL: https://github.com/apache/beam/pull/6216#discussion_r210099936
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionUnexpectedPropertyException.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.options;
+
+import java.util.SortedSet;
+
+/** An exception used when encounter unexpected properties. */
+public class PipelineOptionUnexpectedPropertyException extends 
IllegalArgumentException {
+  private static final long serialVersionUID = 3265630128856068164L;
+
+  private String message;
 
 Review comment:
   You are initializing this field only from a public method which the users of 
the class are not forced to call. It is easy to mis-use and end up with errors. 
Creating a builder with validation, or just passing it to a constructor that 
you call from a static factory method will be safe.
   
   Also, exceptions already have `message` field, and I would probably keep the 
corresponding constructor from the parent class.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 134729)
    Time Spent: 3h  (was: 2h 50m)

> Improve error message when SET unregistered options 
> ----------------------------------------------------
>
>                 Key: BEAM-5141
>                 URL: https://issues.apache.org/jira/browse/BEAM-5141
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to