Using your code from above, with the missing variables and an added "else" clause at the end of your if block (and some output to see what's going on) added like so:
String resp = "b";
boolean success;
try {
if (resp.equals("a")) {
System.out.println("in a");
} else if (resp.equals("b")) {
throw new Exception("b error");
} else if (resp.equals("c")) {
throw new Exception("c error");
} else System.out.println("ended with no match");
} catch (Exception e) {
e.printStackTrace();
}
I get the error thrown as expected if the value of String resp is either "b" or "c". I also get the printout of "in a" if the value of resp is "a".
You don't have an else clause on the end of yours, so if it does not match either a, b or c then it will exit the if/else block and do nothing. No exceptions will be thrown as it has not encountered any code which is throwing them.
Are you certain you have one of these values for your resp variable?