Creating generic method to parse cloudexceptions