File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 66from judgeval .logger import judgeval_logger
77from judgeval import JudgmentClient
88from judgeval .version import get_version
9+ from judgeval .exceptions import JudgmentAPIError
910
1011load_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
You can’t perform that action at this time.
0 commit comments