Enhanced error handling in subsystems and across system calls