We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c00210 commit 1eae75aCopy full SHA for 1eae75a
src/speakeasy.ts
@@ -3,15 +3,20 @@ import { outputError } from "./error";
3
4
let speakeasyInstance: SpeakeasyClient | null = null;
5
6
-export function init(config: Config): SpeakeasyClient {
+export function init(config: Config): SpeakeasyClient | null {
7
if (speakeasyInstance != null) {
8
outputError(
9
"Speakeasy has already been initialized, skipping initialization"
10
);
11
return speakeasyInstance;
12
}
13
14
- speakeasyInstance = new SpeakeasyClient(config);
+ try {
15
+ speakeasyInstance = new SpeakeasyClient(config);
16
+ } catch (err: any) {
17
+ outputError(err.message);
18
+ return null;
19
+ }
20
21
22
0 commit comments