imply-cheddar commented on code in PR #14004:
URL: https://github.com/apache/druid/pull/14004#discussion_r1226106032


##########
processing/src/main/java/org/apache/druid/error/DruidException.java:
##########
@@ -0,0 +1,389 @@
+/*
+ * 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.druid.error;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.google.common.base.Preconditions;
+import org.apache.druid.java.util.common.StringUtils;
+
+import javax.annotation.concurrent.NotThreadSafe;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Represents an error condition exposed to the user and/or operator of Druid. 
 Given that a DruidException is intended
+ * to be delivered to the end user, it should generally never be caught.  
DruidExceptions are generated at terminal
+ * points where the operation that was happening cannot make forward progress. 
 As such, the only reason to catch a
+ * DruidException is if the code has some extra context that it wants to add 
to the message of the DruidException using
+ * {@link #prependAndBuild(String, Object...)}.  If code wants to catch and 
handle an exception instead, it should not
+ * be using the DruidException.

Review Comment:
   Generally speaking, IAE/ISE would disappear and all be replaced by 
`DruidException`.  We can/definitely would continue to have rules that map 
IAE/ISE into `DruidException` (probably as a DEVELOPER-focused persona 
exception), but in the fullness of time, we'd probably want IAE/ISE to be 
replaced with `DruidException` instances.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to