Add check for detailed exceptions

closes #391