Skip to content

Commit 3b3f71d

Browse files
committed
Changed: Replace unwrap() with ? operator in sandboxed example
Propagate errors from tool constructors instead of panicking.
1 parent e071eb7 commit 3b3f71d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
2626
];
2727

2828
// === Create tools with allowed paths ===
29-
let read: ReadTool<true> = ReadTool::new(allowed_paths.clone()).unwrap();
30-
let write = WriteTool::new(allowed_paths.clone()).unwrap();
31-
let edit = EditTool::new(allowed_paths.clone()).unwrap();
32-
let glob = GlobTool::new(allowed_paths.clone()).unwrap();
33-
let grep: GrepTool<true> = GrepTool::new(allowed_paths).unwrap();
29+
let read: ReadTool<true> = ReadTool::new(allowed_paths.clone())?;
30+
let write = WriteTool::new(allowed_paths.clone())?;
31+
let edit = EditTool::new(allowed_paths.clone())?;
32+
let glob = GlobTool::new(allowed_paths.clone())?;
33+
let grep: GrepTool<true> = GrepTool::new(allowed_paths)?;
3434

3535
// === Build agent with sandboxed tools - call .system_prompt() last ===
3636
let mut pb = PreambleBuilder::<false>::new();

0 commit comments

Comments
 (0)