diff --git a/app/models/customer.py b/app/models/customer.py index 1469dad..0a3c1e3 100644 --- a/app/models/customer.py +++ b/app/models/customer.py @@ -47,11 +47,11 @@ class Customer(db.Model): @classmethod def create_customer(cls, id, msisdn, country_code, account_id, account_type='savings'): if cls.query.filter_by(id=id).first(): - raise ValueError("Customer already exists") + raise ValueError("Customer ID '{id}' already exists.") elif Account.query.filter_by(id=account_id).first(): - raise ValueError("Account already exists") + raise ValueError(f"Account ID '{account_id}' already exists.") elif cls.query.filter_by(msisdn=msisdn).first(): - raise ValueError("msisdn already exists") + raise ValueError("MSISDN '{msisdn}' already exists") # Create the customer customer = cls(