Rework custom exception to follow guidelines

Made custom exceptions serializable
Moved exception-related non-serializable information out to events