You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/05/06 07:17:27 UTC

[skywalking] branch master updated: Add catch clause more details. (#2601)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new e6ebf62  Add catch clause more details. (#2601)
e6ebf62 is described below

commit e6ebf62a1fa8a508fe88e17a1339be53cb47f94d
Author: Alan Lau <li...@cmss.chinamobile.com>
AuthorDate: Mon May 6 15:17:20 2019 +0800

    Add catch clause more details. (#2601)
    
    * Add catch clause more details.
    
    * Update SkyWalkingAgent.java
---
 .../java/org/apache/skywalking/apm/agent/SkyWalkingAgent.java     | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/apm-sniffer/apm-agent/src/main/java/org/apache/skywalking/apm/agent/SkyWalkingAgent.java b/apm-sniffer/apm-agent/src/main/java/org/apache/skywalking/apm/agent/SkyWalkingAgent.java
index 033b831..6ef21ec 100644
--- a/apm-sniffer/apm-agent/src/main/java/org/apache/skywalking/apm/agent/SkyWalkingAgent.java
+++ b/apm-sniffer/apm-agent/src/main/java/org/apache/skywalking/apm/agent/SkyWalkingAgent.java
@@ -27,8 +27,10 @@ import net.bytebuddy.dynamic.scaffold.TypeValidation;
 import net.bytebuddy.matcher.ElementMatcher;
 import net.bytebuddy.matcher.ElementMatchers;
 import net.bytebuddy.utility.JavaModule;
+import org.apache.skywalking.apm.agent.core.boot.AgentPackageNotFoundException;
 import org.apache.skywalking.apm.agent.core.boot.ServiceManager;
 import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.agent.core.conf.ConfigNotFoundException;
 import org.apache.skywalking.apm.agent.core.conf.SnifferConfigInitializer;
 import org.apache.skywalking.apm.agent.core.logging.api.ILog;
 import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
@@ -61,6 +63,12 @@ public class SkyWalkingAgent {
 
             pluginFinder = new PluginFinder(new PluginBootstrap().loadPlugins());
 
+        } catch (ConfigNotFoundException ce) {
+            logger.error(ce, "Skywalking agent could not find config. Shutting down.");
+            return;
+        } catch (AgentPackageNotFoundException ape) {
+            logger.error(ape, "Locate agent.jar failure. Shutting down.");
+            return;
         } catch (Exception e) {
             logger.error(e, "Skywalking agent initialized failure. Shutting down.");
             return;