Skip to content

Commit 7b87730

Browse files
committed
Fixes #140 Unable to configure localStorage polyfill when running under AWS Lambda functions
1 parent 8d28760 commit 7b87730

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: packages/node/src/NodeExceptionlessClient.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ export class NodeExceptionlessClient extends ExceptionlessClient {
1919
const config = this.config;
2020

2121
if (configurationOrApiKey && !this._initialized) {
22-
const storage = new LocalStorage(undefined, new LocalStoragePolyfill(process.cwd() + '/.exceptionless'));
23-
config.useLocalStorage = () => storage;
24-
config.services.storage = storage;
22+
try {
23+
const storage = new LocalStorage(undefined, new LocalStoragePolyfill(process.cwd() + '/.exceptionless'));
24+
config.useLocalStorage = () => storage;
25+
config.services.storage = storage;
26+
} catch (ex) {
27+
this.config.services.log.info(`Error configuring localStorage polyfill: ${ex instanceof Error ? ex.message : ex + ''}`);
28+
}
2529

2630
config.addPlugin(new NodeEnvironmentInfoPlugin());
2731
config.addPlugin(new NodeGlobalHandlerPlugin());

0 commit comments

Comments
 (0)