Skip to content

Commit 3a7da9d

Browse files
abhizipstackclaude
andcommitted
fix: address greptile review — network errors and status code handling
- Add !error.request check so Axios network errors (connection refused, server down) still show notifications — only suppress true JS runtime errors that have neither .response nor .request - Use err.to_response() for VisitranBackendBaseException to preserve the exception's own HTTP status code (403, 404, etc.) instead of hardcoding 400 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8674a5a commit 3a7da9d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

backend/backend/core/routers/execute/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def execute_run_command(request: Request, project_id: str) -> Response:
6767
return Response(data=_data)
6868
except (VisitranBaseExceptions, VisitranBackendBaseException) as err:
6969
logger.exception(f"[execute_run_command] DAG execution failed for file_name={file_name}")
70+
if hasattr(err, 'to_response'):
71+
return err.to_response()
7072
return Response(data=err.error_response(), status=status.HTTP_400_BAD_REQUEST)
7173
except Exception:
7274
logger.exception(f"[execute_run_command] Unexpected error during DAG execution for file_name={file_name}")

frontend/src/service/notification-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function NotificationProvider({ children }) {
6161

6262
// Skip notification for JS runtime errors (not API failures)
6363
// These have no useful info for the user — log them for debugging instead
64-
if (error && !error.response && !message && !description) {
64+
if (error && !error.response && !error.request && !message && !description) {
6565
console.error("[Runtime Error]", error);
6666
return;
6767
}

0 commit comments

Comments
 (0)