Skip to content

Commit d56564d

Browse files
committed
Throw error only if the message is provided
1 parent b2b5541 commit d56564d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/manager.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ export namespace SecretsManager {
255255
if (isDisabled('jupyter-secrets-manager:manager')) {
256256
// If the secrets manager is disabled, we need to lock the manager, but not
257257
// throw an error, to let the plugin get activated anyway.
258-
lock('Secret registry is disabled.', false);
258+
console.warn('Secrets manager is disabled.');
259+
lock();
259260
}
260261
if (isDisabled(id)) {
261262
lock(`Sign error: plugin ${id} is disabled.`);
@@ -295,12 +296,10 @@ namespace Private {
295296
*
296297
* @param message - the error message to throw.
297298
*/
298-
export function lock(message: string, throwError = true): void {
299+
export function lock(message?: string): void {
299300
locked = true;
300-
if (throwError) {
301+
if (message) {
301302
throw new Error(message);
302-
} else {
303-
console.warn(message);
304303
}
305304
}
306305

0 commit comments

Comments
 (0)