File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -316,17 +316,6 @@ class VaultInternal {
316316 ) ;
317317 }
318318
319- // Is remote?
320- // well we don't just get remote
321- // we keep track of it
322- public async getRemote ( ) : Promise < [ NodeId , VaultId ] > {
323- // Get the remote if exists
324- // if undefined you consider this to be not remote
325- // and therefore can proceed
326- // return Promise of [NodeId, VaultId]
327- throw Error ( 'Not implemented' ) ;
328- }
329-
330319 @ready ( new vaultsErrors . ErrorVaultNotRunning ( ) )
331320 public async log (
332321 ref : string | VaultRef = 'HEAD' ,
Original file line number Diff line number Diff line change @@ -588,7 +588,11 @@ class VaultManager {
588588 ) ;
589589 if ( existingVaultId == null ) break ;
590590 newVaultName = `${ baseVaultName } -${ attempts } ` ;
591- if ( attempts >= 100 ) throw Error ( 'MAKE PROPER ERROR' ) ;
591+ if ( attempts >= 50 ) {
592+ throw new vaultsErrors . ErrorVaultsNameConflict (
593+ `Too many copies of ${ baseVaultName } ` ,
594+ ) ;
595+ }
592596 attempts ++ ;
593597 }
594598 // Set the vaultName -> vaultId mapping
Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ class ErrorVaultsPermissionDenied extends ErrorVaults {
9494 exitCode = sysexits . NOPERM ;
9595}
9696
97+ class ErrorVaultsNameConflict extends ErrorVaults {
98+ description = 'Unique name could not be created' ;
99+ exitCode = sysexits . UNAVAILABLE ;
100+ }
101+
97102class ErrorSecrets extends ErrorPolykey { }
98103
99104class ErrorSecretsSecretUndefined extends ErrorSecrets {
@@ -127,6 +132,7 @@ export {
127132 ErrorVaultsCreateVaultId ,
128133 ErrorVaultsMergeConflict ,
129134 ErrorVaultsPermissionDenied ,
135+ ErrorVaultsNameConflict ,
130136 ErrorSecrets ,
131137 ErrorSecretsSecretUndefined ,
132138 ErrorSecretsSecretDefined ,
You can’t perform that action at this time.
0 commit comments