mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-09 14:11:33 +02:00
k
This commit is contained in:
@ -646,7 +646,6 @@ def associate_credential_to_connector(
|
|||||||
)
|
)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
# If validation fails, delete the connector and commit the changes
|
# If validation fails, delete the connector and commit the changes
|
||||||
# Ensures we don't leave invalid connectors in the database
|
# Ensures we don't leave invalid connectors in the database
|
||||||
@ -660,10 +659,16 @@ def associate_credential_to_connector(
|
|||||||
)
|
)
|
||||||
except IntegrityError as e:
|
except IntegrityError as e:
|
||||||
logger.error(f"IntegrityError: {e}")
|
logger.error(f"IntegrityError: {e}")
|
||||||
|
delete_connector(db_session, connector_id)
|
||||||
|
db_session.commit()
|
||||||
|
|
||||||
raise HTTPException(status_code=400, detail="Name must be unique")
|
raise HTTPException(status_code=400, detail="Name must be unique")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(f"Unexpected error: {e}")
|
logger.exception(f"Unexpected error: {e}")
|
||||||
|
delete_connector(db_session, connector_id)
|
||||||
|
db_session.commit()
|
||||||
|
|
||||||
raise HTTPException(status_code=500, detail="Unexpected error")
|
raise HTTPException(status_code=500, detail="Unexpected error")
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user