Skip to content

Commit c79cb48

Browse files
Improve throw error comment
1 parent 558411c commit c79cb48

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tools/atlasLocal/atlasLocalTool.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ export abstract class AtlasLocalToolBase extends ToolBase {
1616
const client = this.session.atlasLocalClient;
1717

1818
// If the client is not found, throw an error
19-
// This should never happen, because the tool should have been disabled.
20-
// verifyAllowed in the base class returns false if the client is not found
19+
// This should never happen:
20+
// - atlas-local tools are only added after the client is set
21+
// this means that if we were unable to get the client, the tool will not be registered
22+
// - in case the tool was registered by accident
23+
// verifyAllowed in the base class would still return false preventing the tool from being registered,
24+
// preventing the tool from being executed
2125
if (!client) {
2226
throw new Error("Atlas Local client not found, tool should have been disabled.");
2327
}

0 commit comments

Comments
 (0)