capture any error in VBScript?

后端 未结 5 2221
我在风中等你
我在风中等你 2020-12-09 13:24

I have a batch file that calls a VBScript (.vbs) program. After calling it, my batch script checks %errorlevel% to see if the .vbs program failed. I can signa

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 14:07

    As you say, all that's available is On Error Resume Next, so your forced to use the pattern:

    On Error Resume Next
     ThingWithAChanceOfThrowingAnError ...
    If (Err.number <> 0) then PrintErrorAndQuitWith1(Err.Description)
    

提交回复
热议问题