Skip to content

Commit

Permalink
chore: fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Pokorný <[email protected]>
  • Loading branch information
JanPokorny committed Jan 10, 2025
1 parent f4a5773 commit 8b4707e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/tools/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,17 @@ export class CustomTool extends Tool<StringToolOutput, CustomToolOptions> {
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;
}
}
}

Expand Down Expand Up @@ -123,11 +125,12 @@ export class CustomTool extends Tool<StringToolOutput, CustomToolOptions> {
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;
}
}
}
}

0 comments on commit 8b4707e

Please sign in to comment.