improve error message for command failures