# Chef client exit intentionally

**URL:** <https://discourse.chef.io/t/chef-client-exit-intentionally/13028>\
**Category:** Chef Infra (archive)\
**Created:** [May 8, 2018, 9:12am UTC](https://discourse.chef.io/t/chef-client-exit-intentionally/13028 "2018-05-08T09:12:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![priyanshu](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@priyanshu](https://discourse.chef.io/u/priyanshu)\
**Post date:** [May 8, 2018, 9:12am UTC](https://discourse.chef.io/t/chef-client-exit-intentionally/13028/1 "2018-05-08T09:12:56Z")

</div>

Say I am explicitly aborting chef-client with exit 1 and in resource handling the same with return property.  
The message i see is :- Chef client exit with 1 but expected 0…  
Now I want that instead of this message I can append some more message…Is there any way for this ?

---

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [May 10, 2018, 8:40pm UTC](https://discourse.chef.io/t/chef-client-exit-intentionally/13028/2 "2018-05-10T20:40:34Z")

</div>

There ideally should not be a situation where you are using “exit 1” to fail a Chef Client run. Instead, you should probably be using `raise "Some error message here"`, like this example:

```auto
if node['os'] == 'linux'
  raise "This cookbook does not support Linux"
end

```
