add encoder for exception serialization