Helper for reading/write GoogleAPI compatible errors