monkeyDluffy6017 commented on code in PR #9580:
URL: https://github.com/apache/apisix/pull/9580#discussion_r1266156980


##########
apisix/admin/plugins.lua:
##########
@@ -60,16 +70,20 @@ function _M.get(name)
         return 200, http_plugins
     end
 
-    if not name then
-        return 400, {error_msg = "not found plugin name"}
-    end
+    local plugin
+    -- By default search through http subsystems
+    subsystem = subsystem or "http"
 
-    local plugin_name = "apisix.plugins." .. name
+    if subsystem == "http"  then
+        plugin = plugin_get_http(name)
+    else
+        plugin = plugin_get_stream(name)
+    end
 
-    local ok, plugin = pcall(require, plugin_name)
-    if not ok then
-        core.log.warn("failed to load plugin [", name, "] err: ", plugin)
-        return 400, {error_msg = "failed to load plugin " .. name}
+    if not plugin then
+        local err = "failed to load plugin " .. name .. " in subsystem " .. 
subsystem
+        core.log.warn("failed to load plugin [", name, "] err: ", err)
+        return 404, {error_msg = "plugin not found"}

Review Comment:
   "plugin " .. name .. " is not found in subsystem " .. subsystem



-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to