Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
add breaks to case and catch all exception in case somethings goes wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
varun7654 committed Jan 4, 2022
1 parent 558a8ce commit d0942f8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ public boolean execute() {
switch (methodName) {
case "print":
System.out.println(objArgs[0]);
break;
case "sleep":
Thread.sleep((long) objArgs[0]);
break;
}
} catch (InterruptedException e) {
DriverStation.reportError("Thread interrupted while sleeping", e.getStackTrace());
return false;
} catch (Exception e) {
DriverStation.reportError("Could not invoke method " + methodName, e.getStackTrace());
return false;
}
}
return true;
Expand Down

0 comments on commit d0942f8

Please sign in to comment.