@@ -27,6 +27,7 @@ import scala.collection.mutable.ListBuffer
27
27
import io .swagger .v3 .oas .annotations .media .Content
28
28
import io .swagger .v3 .oas .annotations .responses .ApiResponse
29
29
import io .swagger .v3 .oas .annotations .tags .Tag
30
+ import org .apache .zookeeper .KeeperException .NoNodeException
30
31
31
32
import org .apache .kyuubi .{KYUUBI_VERSION , Logging , Utils }
32
33
import org .apache .kyuubi .client .api .v1 .dto .Engine
@@ -140,9 +141,19 @@ private[v1] class AdminResource extends ApiRequestContext with Logging {
140
141
}
141
142
case None =>
142
143
withDiscoveryClient(fe.getConf) { discoveryClient =>
143
- discoveryClient.getChildren(engineSpace).map { child =>
144
- info(s " Listing engine nodes for $engineSpace/ $child" )
145
- engineNodes ++= discoveryClient.getServiceNodesInfo(s " $engineSpace/ $child" )
144
+ try {
145
+ discoveryClient.getChildren(engineSpace).map { child =>
146
+ info(s " Listing engine nodes for $engineSpace/ $child" )
147
+ engineNodes ++= discoveryClient.getServiceNodesInfo(s " $engineSpace/ $child" )
148
+ }
149
+ } catch {
150
+ case nne : NoNodeException =>
151
+ error(
152
+ s " No such engine for user: $userName, " +
153
+ s " engine type: $engineType, share level: $shareLevel, subdomain: $subdomain" ,
154
+ nne)
155
+ throw new NotFoundException (s " No such engine for user: $userName, " +
156
+ s " engine type: $engineType, share level: $shareLevel, subdomain: $subdomain" )
146
157
}
147
158
}
148
159
}
0 commit comments