detect runtime error from exitcode