Files
dataservices-api/server/lib/python/cartodb_services/cartodb_services/google/exceptions.py
Mario de Frutos 61efb66aba Add an extra check for google credentials
If the user has a wrong base64 padded secret key the googlemaps
python library is returning "TypeError: Incorrect padding" which
is very hard to understand. So now we check if the secret key is
a valid base64 string
2017-05-26 11:51:32 +02:00

24 lines
538 B
Python

#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import json
class InvalidGoogleCredentials(Exception):
pass
class BadGeocodingParams(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr('Bad geocoding params: ' + json.dumps(self.value))
class NoGeocodingParams(Exception):
def __str__(self):
return repr('No params for geocoding specified')
class MalformedResult(Exception):
def __str__(self):
return repr('Result structure is malformed')