Skip to content

Commit db8b96a

Browse files
fixes
1 parent abfebbe commit db8b96a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/McpContext.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ function getNetworkMultiplierFromString(condition: string | null): number {
5858
return 1;
5959
}
6060

61-
function getExtensionFromMimeType(
62-
mimeType: 'image/png' | 'image/jpeg' | 'image/webp',
63-
) {
61+
function getExtensionFromMimeType(mimeType: string) {
6462
switch (mimeType) {
6563
case 'image/png':
6664
return 'png';
@@ -369,7 +367,7 @@ export class McpContext implements Context {
369367
return {filename};
370368
} catch (err) {
371369
this.logger(err);
372-
throw new Error('Could not save a screenshot to a file');
370+
throw new Error('Could not save a screenshot to a file', {cause: err});
373371
}
374372
}
375373
async saveFile(
@@ -382,7 +380,7 @@ export class McpContext implements Context {
382380
return {filename};
383381
} catch (err) {
384382
this.logger(err);
385-
throw new Error('Could not save a screenshot to a file');
383+
throw new Error('Could not save a screenshot to a file', {cause: err});
386384
}
387385
}
388386

0 commit comments

Comments
 (0)