Skip to content

Commit 61eb0fb

Browse files
surajitsurajit
authored andcommitted
bug fix in exception catch for company creation
1 parent 5e1c150 commit 61eb0fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routes/v1/company.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def create_company(company: schema.CreateCompany, db: Session = Depends(get_db))
2222
try:
2323
db_company = _company.create_company(db, company)
2424
company = utils.create_company(data=company.dict())
25-
except (utils.ContactException, CompanyExistException) as exc:
26-
if isinstance(exc, utils.ContactException) and db_company:
25+
except (utils.CompanyException, CompanyExistException) as exc:
26+
if isinstance(exc, utils.CompanyException) and db_company:
2727
_company.delete_company(db, db_company.id)
2828
raise HTTPException(status_code=200, detail=str(exc))
2929
return company

0 commit comments

Comments
 (0)