megaed-sv: add exception handler