11package io .dongtai .iast .common .config ;
22
3+ import io .dongtai .log .DongTaiLog ;
4+ import io .dongtai .log .ErrorCode ;
35import org .json .*;
46
57import java .util .HashMap ;
@@ -49,6 +51,7 @@ public void updateFromRemote(String content) {
4951 JSONObject json = new JSONObject (content );
5052 config = json .getJSONObject ("data" );
5153 } catch (JSONException ignore ) {
54+ DongTaiLog .error (ErrorCode .UTIL_CONFIG_LOAD_FAILED ,ignore .getMessage ());
5255 }
5356
5457 update (config );
@@ -72,7 +75,8 @@ public void update(JSONObject config) {
7275 public <T > T get (ConfigKey key ) {
7376 try {
7477 return ((Config <T >) getConfig (key )).get ();
75- } catch (Throwable ignore ) {
78+ } catch (Throwable e ) {
79+ DongTaiLog .error (ErrorCode .UTIL_CONFIG_LOAD_FAILED ,e .getMessage ());
7680 return null ;
7781 }
7882 }
@@ -85,7 +89,8 @@ private void updateBool(JSONObject config, ConfigKey.JsonKey jsonKey) {
8589 Boolean value = config .getBoolean (jsonKey .getKey ());
8690 conf .setValue (value );
8791 }
88- } catch (Throwable ignore ) {
92+ } catch (Throwable e ) {
93+ DongTaiLog .error (ErrorCode .UTIL_CONFIG_LOAD_FAILED ,e .getMessage ());
8994 }
9095 }
9196
@@ -97,7 +102,8 @@ private void updateInt(JSONObject config, ConfigKey.JsonKey jsonKey) {
97102 Integer value = config .getInt (jsonKey .getKey ());
98103 conf .setValue (value );
99104 }
100- } catch (Throwable ignore ) {
105+ } catch (Throwable e ) {
106+ DongTaiLog .error (ErrorCode .UTIL_CONFIG_LOAD_FAILED ,e .getMessage ());
101107 }
102108 }
103109
@@ -111,7 +117,8 @@ private void updateString(JSONObject config, ConfigKey.JsonKey jsonKey) {
111117 conf .setValue (value );
112118 }
113119 }
114- } catch (Throwable ignore ) {
120+ } catch (Throwable e ) {
121+ DongTaiLog .error (ErrorCode .UTIL_CONFIG_LOAD_FAILED ,e .getMessage ());
115122 }
116123 }
117124
@@ -125,7 +132,8 @@ private void updateRequestDenyList(JSONObject config) {
125132 RequestDenyList requestDenyList = RequestDenyList .parse (value );
126133 conf .setValue (requestDenyList );
127134 }
128- } catch (Throwable ignore ) {
135+ } catch (Throwable e ) {
136+ DongTaiLog .error (ErrorCode .UTIL_CONFIG_LOAD_FAILED ,e .getMessage ());
129137 }
130138 }
131139}
0 commit comments