Refactored exceptions.js
Support in sending customAttributes in exceptions