Added option to fail when the status is not success