Often times only a specific error code needs to be handled.
Code: Select all
try ComCall()
catch OSError as e
if e.Number = 0x1
; Do something
; Restore default error behavior for other HRESULT codes
Code: Select all
try ComCall()
catch OSError as e
if e.Number = 0x1
; Do something
; Restore default error behavior for other HRESULT codes
Code: Select all
#Requires AutoHotkey v2.0-a138-7538f26f
try ComCall()
catch OSError as e
{
if e.Number = 0x1
; Do something
else
{
; Restore default error behavior for other HRESULT codes
throw
}
}