Skip to content

Commit

Permalink
fix(envs): manage exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelje authored and Hector Rondon committed Jan 18, 2018
1 parent 4cbde3b commit 3056820
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions inventory/src/main/java/org/flyve/inventory/categories/Envs.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

import android.content.Context;

import org.flyve.inventory.FILog;

import java.util.Map;

/**
Expand All @@ -60,13 +62,17 @@ public class Envs extends Categories {
public Envs(Context xCtx) {
super(xCtx);

//get all envs vars
Map<String,String> envs = System.getenv();
for( Map.Entry<String,String> entry : envs.entrySet()) {
Category c = new Category("ENVS", "envs");
c.put("KEY", new CategoryValue(entry.getKey(),"KEY","key"));
c.put("VAL", new CategoryValue(envs.get(entry.getKey()),"VAL","Value"));
this.add(c);
try {
//get all envs vars
Map<String, String> envs = System.getenv();
for (Map.Entry<String, String> entry : envs.entrySet()) {
Category c = new Category("ENVS", "envs");
c.put("KEY", new CategoryValue(entry.getKey(), "KEY", "key"));
c.put("VAL", new CategoryValue(envs.get(entry.getKey()), "VAL", "Value"));
this.add(c);
}
} catch (Exception ex) {
FILog.e(ex.getMessage());
}
}
}

0 comments on commit 3056820

Please sign in to comment.