Skip to content

Commit 44941a5

Browse files
Improve error handling
1 parent 7b37b41 commit 44941a5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/seclab_taskflows/mcp_servers/codeql_python/mcp_server.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _csv_parse(raw):
126126
this_obj[k.strip()] = row[j + 2]
127127
results.append(this_obj)
128128
except (csv.Error, IndexError, ValueError) as e:
129-
return ["Error: CSV parsing error: " + str(e)]
129+
return f"Error: CSV parsing error: {e}"
130130
return results
131131

132132

@@ -167,8 +167,6 @@ def remote_sources(owner: str = Field(description="The owner of the GitHub repos
167167
# Check if results is an error (list of strings) or valid data (list of dicts)
168168
if isinstance(results, str):
169169
return f"Error: {results}"
170-
if results and isinstance(results[0], str):
171-
return f"Error: {results[0]}"
172170

173171
# Store each result as a source
174172
stored_count = 0

0 commit comments

Comments
 (0)