Skip to content

Commit

Permalink
fix(cpus): 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 7a41c39 commit 6dcbf0b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions inventory/src/main/java/org/flyve/inventory/categories/Cpus.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,28 @@ public class Cpus extends Categories {
public Cpus(Context xCtx) {
super(xCtx);

Category c = new Category("CPUS", "cpus");

// Cpu Name
String cpuName = "";
try {
Category c = new Category("CPUS", "cpus");

// Cpu Name
String cpuName;

cpuName = getCpuName();
} catch (Exception ex) {
FILog.e(ex.getMessage());
}
c.put("NAME", new CategoryValue(cpuName, "NAME", "name"));

// Cpu Frequency
String cpuFrequency = "";
try {
c.put("NAME", new CategoryValue(cpuName, "NAME", "name"));

// Cpu Frequency
String cpuFrequency;

cpuFrequency = getCpuFrequency();
c.put("SPEED", new CategoryValue(cpuFrequency, "SPEED", "cpuFrequency"));

this.add(c);

} catch (Exception ex) {
FILog.e(ex.getMessage());
}
c.put("SPEED", new CategoryValue(cpuFrequency, "SPEED","cpuFrequency"));

this.add(c);
}

/**
Expand Down

0 comments on commit 6dcbf0b

Please sign in to comment.