Skip to content

Commit 6bcbe57

Browse files
authored
Merge pull request #153 from gHashTag/feat/issue-150
fix(bot): replace catch unreachable with proper error handling in claude_stream.zig
2 parents 53df6a5 + 6f9b8fb commit 6bcbe57

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tools/mcp/trinity_mcp/bot/claude_stream.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ pub fn runStreaming(
6464
};
6565
defer allocator.free(api_url);
6666

67-
const uri = std.Uri.parse(api_url) catch unreachable;
67+
const uri = std.Uri.parse(api_url) catch |err| {
68+
std.log.err("Invalid API URL: {s} — {}", .{ api_url, err });
69+
telegram_api.sendMessage(allocator, config.bot_token, config.chat_id, "\xe2\x9d\x8c Invalid API URL");
70+
return;
71+
};
6872

6973
var req = client.request(.POST, uri, .{
7074
.extra_headers = &.{

0 commit comments

Comments
 (0)