我在我的项目中有错误,我需要使用 试试看,catch和 终于来处理这个问题。
我可以在 JavaScript 中使用它,但不能在 Typecript 中使用。
当我把 例外 作为参数在类型脚本 接住语句,为什么它不接受这一点?
这是密码。
private handling(argument: string): string {
try {
result= this.markLibrary(argument);
}
catch(e:Exception){
result = e.Message;
}
return result;
}
我需要一个异常消息在这里,但我不能得到。我得到了下面的错误。
Catch 子句变量不能有类型注释。