Fix Erroneous 'Duplicate Entry' error message

Change-Id: Ic296c493b37c1689e4c24c9402830e6120b8a085
This commit is contained in:
Chi Lo 2020-01-22 13:18:49 -08:00
parent 8f4ffa31e7
commit 5548613de6

View File

@ -60,13 +60,8 @@ class CustomerController(rest.RestController):
except TypeError:
raise ErrorStatus(409.1, 'Unable to create Customer ID {0}'.format(customer.uuid))
try:
result = customer_logic.create_customer(customer, uuid, request.transaction_id)
result = customer_logic.create_customer(customer, uuid, request.transaction_id)
except ValueError as exception:
raise
except Exception as exception:
raise ErrorStatus(409.2, 'Customer already exists.Error:{0}'.format(str(exception)))
LOG.info("CustomerController - Customer Created: " + str(result))
event_details = 'Customer {} {} created in regions: {}, with users: {}'.format(
uuid, customer.name, [r.name for r in customer.regions],