try {
System.out.println(1 / 0);//会抛出ArithmeticException
System.out.println(new int[] {}[0]);//会抛出ArrayIndexOutOfBoundsException
String str = null;
System.out.println(str.toString());//会抛出NullPointerException
} catch (ArithmeticException e) {
resultMap.put("errMsg", e.getMessage());
System.out.println("算术异常");
System.out.println(e.getMessage());
return ERROR;
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("数组下标越界异常");
return ERROR;
} catch (NullPointerException e) {
System.out.println("空指针异常");
return ERROR;
}