Skip to content

Commit e8df0ec

Browse files
author
Judgment Release Bot
committed
[Bump Minor Version] Release: Merge staging to main
2 parents 1ea6e32 + 5233fee commit e8df0ec

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/judgeval/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ def upload_custom_scorer(
170170
judgeval_logger.error(f"Failed to upload custom scorer: {unique_name}")
171171
return False
172172

173-
except Exception as e:
174-
judgeval_logger.error(f"Error uploading custom scorer: {e}")
173+
except Exception:
175174
raise
176175

177176

src/judgeval/cli.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from judgeval.logger import judgeval_logger
77
from judgeval import JudgmentClient
88
from judgeval.version import get_version
9+
from judgeval.exceptions import JudgmentAPIError
910

1011
load_dotenv()
1112

@@ -56,8 +57,15 @@ def upload_scorer(
5657
judgeval_logger.error("Failed to upload custom scorer")
5758
raise typer.Exit(1)
5859

60+
judgeval_logger.info("Custom scorer uploaded successfully!")
5961
raise typer.Exit(0)
60-
except Exception:
62+
except Exception as e:
63+
if isinstance(e, JudgmentAPIError) and e.status_code == 409:
64+
judgeval_logger.error(
65+
"Duplicate scorer detected. Use --overwrite flag to replace the existing scorer"
66+
)
67+
raise typer.Exit(1)
68+
# Re-raise other exceptions
6169
raise
6270

6371

0 commit comments

Comments
 (0)