💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
>[danger]**1. try...catch 处理** 示例: ~~~ try{ //要检测的代码 m(); //这里写一个未定义的函数 }catch(e){ console.log(e.message); } //返回结果: m is not defined ~~~ >[danger]**2. 手动抛出错误** 示例: ~~~ try{ var a = 888; if(a<1000){ throw new Error(a小于1000); } }catch(e){ console.log(e.message); } //返回结果:a小于1000 ~~~