added a way to make errors nicer when serialized