Skip to content

Instantly share code, notes, and snippets.

@gocha
Created January 5, 2018 07:20
Show Gist options
  • Save gocha/337b5e904d041cd912f95607889fe0b8 to your computer and use it in GitHub Desktop.
Save gocha/337b5e904d041cd912f95607889fe0b8 to your computer and use it in GitHub Desktop.
[VBScript] Error Handling (exit with status 1, if a runtime error is raised)
Call EntryPoint
Sub EntryPoint()
On Error Resume Next
Call Main
If Err <> 0 Then
WScript.Echo Err.Source & ": " & Err.Description & " (Error " & Err.Number & ")"
WScript.Quit(1)
End If
End Sub
Sub Main()
' TODO write your code here
foo
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment