Skip to content

Commit b2b5541

Browse files
committed
Do not throw if secrets manager is disabled
1 parent 101d782 commit b2b5541

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/manager.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ export namespace SecretsManager {
253253
throw new Error('Secrets manager is locked, check errors.');
254254
}
255255
if (isDisabled('jupyter-secrets-manager:manager')) {
256-
lock('Secret registry is disabled.');
256+
// If the secrets manager is disabled, we need to lock the manager, but not
257+
// throw an error, to let the plugin get activated anyway.
258+
lock('Secret registry is disabled.', false);
257259
}
258260
if (isDisabled(id)) {
259261
lock(`Sign error: plugin ${id} is disabled.`);
@@ -293,9 +295,13 @@ namespace Private {
293295
*
294296
* @param message - the error message to throw.
295297
*/
296-
export function lock(message: string) {
298+
export function lock(message: string, throwError = true): void {
297299
locked = true;
298-
throw new Error(message);
300+
if (throwError) {
301+
throw new Error(message);
302+
} else {
303+
console.warn(message);
304+
}
299305
}
300306

301307
/**

0 commit comments

Comments
 (0)