Skip to content

Commit 3b47bf7

Browse files
Update src/mcp/resources/environment.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 2ceb272 commit 3b47bf7

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/mcp/resources/environment.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,19 @@ export default {
2525

2626
if (result.isError) {
2727
const errorText = result.content[0]?.text;
28-
throw new Error(
29-
typeof errorText === 'string' ? errorText : 'Failed to retrieve environment data',
30-
);
28+
const errorMessage = typeof errorText === 'string'
29+
? errorText
30+
: 'Failed to retrieve environment data';
31+
log('error', `Error in environment resource handler: ${errorMessage}`);
32+
return {
33+
contents: [
34+
{
35+
text: `Error retrieving environment data: ${errorMessage}`,
36+
},
37+
],
38+
};
3139
}
40+
// ... rest of the function
3241

3342
return {
3443
contents: [

0 commit comments

Comments
 (0)