Skip to content

Commit c22ef48

Browse files
committed
redirect error messages to stderr in send_to_server function
1 parent aa4adc9 commit c22ef48

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cli/commands/analyze.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,20 @@ def send_to_server(data):
3939
print("✓ New analysis sent to server")
4040
return True
4141
else:
42-
print(f"⚠ Server responded with status {response.status_code}")
42+
print(f"⚠ Server responded with status {response.status_code}", file=sys.stderr)
4343
return False
4444

4545
except requests.exceptions.ConnectionError:
46-
print("⚠ Could not connect to server - make sure it's running on localhost:3000")
46+
print("⚠ Could not connect to server - make sure it's running on localhost:3000", file=sys.stderr)
4747
return False
4848
except requests.exceptions.Timeout:
49-
print("⚠ Server request timed out")
49+
print("⚠ Server request timed out", file=sys.stderr)
5050
return False
5151
except Exception as e:
52-
print(f"⚠ Error sending to server: {e}")
52+
print(f"⚠ Error sending to server: {e}", file=sys.stderr)
5353
return False
5454

55+
5556
def analyze_command(file, all, json_output, LANG_FILE):
5657
"""
5758
Analyze the given file.

0 commit comments

Comments
 (0)