Skip to content

Commit 631ac07

Browse files
authored
Merge pull request #997 from MolSSI/proj_link_fix
Fix unfriendly errors with project link_dataset/link_record
2 parents c332ec0 + 6eb164f commit 631ac07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qcfractal/qcfractal/components/project_socket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def link_dataset(
441441
r = session.execute(stmt).scalar_one_or_none()
442442

443443
if r is None:
444-
raise ValueError(f"Dataset {dataset_id} already linked to project {project_id}")
444+
raise AlreadyExistsError(f"Dataset {dataset_id} already linked to project {project_id}")
445445

446446
def unlink_datasets(
447447
self,
@@ -633,7 +633,7 @@ def link_record(
633633
r = session.execute(stmt).scalar_one_or_none()
634634

635635
if r is None:
636-
raise ValueError(f"Record {record_id} already linked to project {project_id}")
636+
raise AlreadyExistsError(f"Record {record_id} already linked to project {project_id}")
637637

638638
def unlink_records(
639639
self, project_id: int, record_ids: Iterable[int], delete_records: bool, *, session: Optional[Session] = None

0 commit comments

Comments
 (0)