foo()
If ErrorLevel
Msgbox calling foo failed with: %ErrorLevel%
{
If success
Return
Else
ErrorLevel = foo_error
}