Throw an error in case when command returns code other than 0