Formatting fixes
Added conditional check for exception detail