Only catch NonFatal exceptions.
Print full stack trace for miscellaneous exceptions during serialization.