@@ -141,9 +141,7 @@ async def get(self, job_definition_id=None):
141141 list_response = await ensure_async (self .scheduler .list_job_definitions (list_query ))
142142 except ValidationError as e :
143143 self .log .exception (e )
144- raise HTTPError (
145- 500 , f"Unexpected error while getting job definition list: { e } "
146- ) from e
144+ raise HTTPError (400 , f"Validation error: { e } " ) from e
147145 except SchedulerError as e :
148146 self .log .exception (e )
149147 raise HTTPError (
@@ -170,9 +168,7 @@ async def post(self):
170168 )
171169 except ValidationError as e :
172170 self .log .exception (e )
173- raise HTTPError (
174- 500 , f"Unexpected error during creation of job definition: { e } "
175- ) from e
171+ raise HTTPError (400 , f"Validation error: { e } " ) from e
176172 except InputUriError as e :
177173 self .log .exception (e )
178174 raise HTTPError (
@@ -205,9 +201,7 @@ async def patch(self, job_definition_id):
205201 )
206202 except ValidationError as e :
207203 self .log .exception (e )
208- raise HTTPError (
209- 500 , f"Unexpected error while updating the job definition: { e } "
210- ) from e
204+ raise HTTPError (400 , f"Validation error: { e } " ) from e
211205 except SchedulerError as e :
212206 self .log .exception (e )
213207 raise HTTPError (
@@ -311,9 +305,7 @@ async def get(self, job_id=None):
311305 self .log .warning (f"Failed to sync status for job { job .job_id } : { e } " )
312306 except ValidationError as e :
313307 self .log .exception (e )
314- raise HTTPError (
315- 500 , f"Unexpected error while getting jobs list: { e } "
316- ) from e
308+ raise HTTPError (400 , f"Validation error: { e } " ) from e
317309 except SchedulerError as e :
318310 self .log .exception (e )
319311 raise HTTPError (
@@ -344,9 +336,7 @@ async def post(self):
344336 # Job ID is already in backend:uuid format from scheduler (no wrapping needed)
345337 except ValidationError as e :
346338 self .log .exception (e )
347- raise HTTPError (
348- 500 , f"Unexpected error during creation of job: { e } "
349- ) from e
339+ raise HTTPError (400 , f"Validation error: { e } " ) from e
350340 except InputUriError as e :
351341 self .log .exception (e )
352342 raise HTTPError (
@@ -395,9 +385,7 @@ async def patch(self, job_id):
395385 await ensure_async (scheduler .update_job (job_id , UpdateJob (** payload )))
396386 except ValidationError as e :
397387 self .log .exception (e )
398- raise HTTPError (
399- 500 , f"Unexpected error while updating the job: { e } "
400- ) from e
388+ raise HTTPError (400 , f"Validation error: { e } " ) from e
401389 except SchedulerError as e :
402390 self .log .exception (e )
403391 raise HTTPError (
@@ -443,9 +431,7 @@ async def post(self, job_definition_id: str):
443431 )
444432 except ValidationError as e :
445433 self .log .exception (e )
446- raise HTTPError (
447- 500 , f"Unexpected error during creation of job: { e } "
448- ) from e
434+ raise HTTPError (400 , f"Validation error: { e } " ) from e
449435 except SchedulerError as e :
450436 self .log .exception (e )
451437 raise HTTPError (
0 commit comments