mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-01-18 21:52:48 +08:00
CB-11384 android: Does not pass sonarqube scan
The problem is "Empty Catch Block", which sonarqube considers a blocker. Added a log message to the empty block.
This commit is contained in:
parent
83e870bf4e
commit
da7e85ec92
@ -127,7 +127,9 @@ public class NetworkManager extends CordovaPlugin {
|
||||
String connectionType = "";
|
||||
try {
|
||||
connectionType = this.getConnectionInfo(info).get("type").toString();
|
||||
} catch (JSONException e) { }
|
||||
} catch (JSONException e) {
|
||||
Log.d(LOG_TAG, e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, connectionType);
|
||||
pluginResult.setKeepCallback(true);
|
||||
@ -171,7 +173,9 @@ public class NetworkManager extends CordovaPlugin {
|
||||
String connectionType = "";
|
||||
try {
|
||||
connectionType = thisInfo.get("type").toString();
|
||||
} catch (JSONException e) { }
|
||||
} catch (JSONException e) {
|
||||
Log.d(LOG_TAG, e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
sendUpdate(connectionType);
|
||||
lastInfo = thisInfo;
|
||||
@ -206,7 +210,9 @@ public class NetworkManager extends CordovaPlugin {
|
||||
try {
|
||||
connectionInfo.put("type", type);
|
||||
connectionInfo.put("extraInfo", extraInfo);
|
||||
} catch (JSONException e) { }
|
||||
} catch (JSONException e) {
|
||||
Log.d(LOG_TAG, e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
return connectionInfo;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user