Write gzipped json and catch and raise errors when reasing a pickle