diff --git a/src/keria/app/agenting.py b/src/keria/app/agenting.py index 7876073b..9ecdc1cf 100644 --- a/src/keria/app/agenting.py +++ b/src/keria/app/agenting.py @@ -890,8 +890,8 @@ def on_post(self, req, rep): caid = icp.pre if self.agency.get(caid=caid) is not None: - raise falcon.HTTPBadRequest(title="agent already exists", - description=f"agent for controller {caid} already exists") + raise falcon.HTTPConflict(title="agent already exists", + description=f"agent for controller {caid} already exists") agent = self.agency.create(caid=caid) diff --git a/tests/app/test_agenting.py b/tests/app/test_agenting.py index 2a31c2c5..c6ef6593 100644 --- a/tests/app/test_agenting.py +++ b/tests/app/test_agenting.py @@ -224,7 +224,7 @@ def test_boot_ends(helpers): assert rep.status_code == 202 rep = client.simulate_post("/boot", body=json.dumps(body).encode("utf-8")) - assert rep.status_code == 400 + assert rep.status_code == 409 assert rep.json == { 'title': 'agent already exists', 'description': 'agent for controller EK35JRNdfVkO4JwhXaSTdV4qzB_ibk_tGJmSVcY4pZqx already exists'