Creating a database that already exists in the glue data catalog raises an exception

This commit is contained in:
TheDooner64 2018-07-11 11:39:40 -04:00
commit c5c57efbb5
3 changed files with 29 additions and 5 deletions

View file

@ -1,9 +1,15 @@
from __future__ import unicode_literals
from moto.core.exceptions import RESTError
from moto.core.exceptions import JsonRESTError
class GlueClientError(RESTError):
class GlueClientError(JsonRESTError):
code = 400
def __init__(self, *args, **kwargs):
kwargs.setdefault('template', 'single_error')
super(GlueClientError, self).__init__(*args, **kwargs)
class DatabaseAlreadyExistsException(GlueClientError):
def __init__(self):
self.code = 400
super(DatabaseAlreadyExistsException, self).__init__(
'DatabaseAlreadyExistsException',
'Database already exists.'
)