Commit 8df13ec2 by neel

Handling Try catch with Error code and message

parent 56411dfc
......@@ -75,7 +75,7 @@ public class LeaderCalc {
}catch(ResourceNotFoundException e) {
calc = new JSONObject();
calc.put("Error_Code", "500");
calc.put("Error_Code", "503");
calc.put("Error_Message", "Technical Error caught while calculating");
System.out.println(e);
e.printStackTrace();
......@@ -83,7 +83,7 @@ public class LeaderCalc {
}catch(Exception e) {
calc = new JSONObject();
calc.put("Error_Code", "500");
calc.put("Error_Code", "503");
calc.put("Error_Message", "Technical Error caught while calculating");
e.printStackTrace();
System.out.println(e);
......
......@@ -25,10 +25,10 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
LeaderCalcConfig leaderCalcConfig;
public JSONObject calculate(String data) {
JSONObject Calc_JSON = null;
JSONObject InputData = new JSONObject(data);
Calc_JSON = InputData.getJSONObject("CALC_JSON");
JSONObject Calc_JSON = InputData.getJSONObject("CALC_JSON");
String leader_code = Calc_JSON.getString("LEADER_CODE");
String leader_designation = Calc_JSON.getString("LEADER_DESIGNATION");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment