From 8b4707ef5e07148e02e6eb74d52a85ce0f81b92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= Date: Thu, 9 Jan 2025 17:43:24 +0100 Subject: [PATCH] chore: fix formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- src/tools/custom.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/tools/custom.ts b/src/tools/custom.ts index 8d7da548..0a5757ec 100644 --- a/src/tools/custom.ts +++ b/src/tools/custom.ts @@ -87,15 +87,17 @@ export class CustomTool extends Tool { signal: run.signal, }); - if(result.stderr) - throw new CustomToolExecuteError(result.stderr) - + if (result.stderr) { + throw new CustomToolExecuteError(result.stderr); + } + return new StringToolOutput(result.tool_output_json); - } catch(e) { - if(e instanceof ToolError) + } catch (e) { + if (e instanceof ToolError) { throw new CustomToolExecuteError(e.message, [e]); - else + } else { throw e; + } } } @@ -123,11 +125,12 @@ export class CustomTool extends Tool { description: result.tool_description, inputSchema: JSON.parse(result.tool_input_schema_json), }); - } catch(e) { - if(e instanceof ToolError) + } catch (e) { + if (e instanceof ToolError) { throw new CustomToolCreateError(e.message, [e]); - else + } else { throw e; + } } } }