javascript – How to use exceptions when using assert

I have started to use Protractor together with Mocha and Chai. I have came to a part where I have done some asserts etc:

   const attributes = await TestingModal.getButtonAttributes(driver, myCss)
   assert.equal(attributes.text, 'Testing', 'Incorrect text button');

However I realized that if the assert doesn’t match it will print out the “Incorrect text button” and will put it as fail. However what happens etc if the attributes doesn’t get any value. That would just throw an error as well. My question is if there is a way I could caught all the expections as a “failed test” when using assert?