Skip to content

Commit 7bfed35

Browse files
add try catch block for lit connections and remove logs
Co-authored-by: awisniew207 <[email protected]> Signed-off-by: Robert Mads Christensen <[email protected]>
1 parent 02e4272 commit 7bfed35

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

packages/lit-auth-client/src/lib/providers/BaseProvider.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,16 @@ export abstract class BaseProvider {
180180
rpc: LIT_RPC.CHRONICLE_YELLOWSTONE
181181
});
182182

183-
console.log("🔄 Connecting to Lit Contracts...");
184-
await litContracts.connect();
185-
console.log("✅ Connected to Lit Contracts");
186-
187-
let pkps: IRelayPKP[] = [];
183+
try {
184+
await litContracts.connect();
185+
} catch (err) {
186+
throw new UnknownError(
187+
{
188+
cause: err,
189+
},
190+
'Unable to connect to LitContracts'
191+
);
192+
}
188193
try {
189194
const pkpPermissions = litContracts.pkpPermissionsContract;
190195
const tokenIds = await pkpPermissions.read.getTokenIdsForAuthMethod(

0 commit comments

Comments
 (0)