You should check the OS-ERROR function after the OS-... statements.
https://docs.progress.com/de-DE/bundle/abl-reference/page/OS-ERROR-function.html