Skip to content

Commit

Permalink
fix(Agent): Propagate non-job request exceptions to foreground
Browse files Browse the repository at this point in the history
For requests that aren't jobs, it's easier to debug the cause if they
are propagated to frontend rather than logged
  • Loading branch information
balamurali27 committed Dec 23, 2024
1 parent ed58508 commit 62beb44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions press/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,8 @@ def request(self, method, path, data=None, files=None, agent_job=None, raises=Tr
doc=agent_job,
)
except Exception as exc:
self.handle_exception(agent_job, exc)
self.log_request_failure(exc)
self.handle_exception(agent_job, exc)
log_error(
title="Agent Request Exception",
method=method,
Expand Down Expand Up @@ -853,7 +853,7 @@ def should_skip_requests(self):

def handle_request_failure(self, agent_job, result: "Response"):
if not agent_job:
return
raise

Check warning on line 856 in press/agent.py

View check run for this annotation

Codecov / codecov/patch

press/agent.py#L856

Added line #L856 was not covered by tests

reason = None
with suppress(TypeError, ValueError):
Expand All @@ -871,7 +871,7 @@ def handle_exception(self, agent_job, exception):

def log_failure_reason(self, agent_job=None, message=None):
if not agent_job:
return
raise

agent_job.traceback = message
agent_job.output = message
Expand Down

0 comments on commit 62beb44

Please sign in to comment.