如果我有以下内容:
问题是: 如何在catch块中捕获这个特定的异常?
function ValidationException(nr, msg){
this.message = msg;
this.name = "my exception";
this.number = nr;
}
function myFunction(dayOfWeek){
if(dayOfWeek > 7){
throw new ValidationException(dayOfWeek, "7days only!");
}
}
问题是: 如何在catch块中捕获这个特定的异常?