test capturing error code of command