make dump_exceptions key work also for mason exceptions

(cherry picked from commit 0bcbca4042552038850f50734c0ba4ebec3362a2)