Only ignore socket errors, not all exceptions.
Stringify objects that aren't JSON-serializable.