File tree 3 files changed +11
-12
lines changed
3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -316,17 +316,6 @@ class VaultInternal {
316
316
) ;
317
317
}
318
318
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
-
330
319
@ready ( new vaultsErrors . ErrorVaultNotRunning ( ) )
331
320
public async log (
332
321
ref : string | VaultRef = 'HEAD' ,
Original file line number Diff line number Diff line change @@ -588,7 +588,11 @@ class VaultManager {
588
588
) ;
589
589
if ( existingVaultId == null ) break ;
590
590
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
+ }
592
596
attempts ++ ;
593
597
}
594
598
// Set the vaultName -> vaultId mapping
Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ class ErrorVaultsPermissionDenied extends ErrorVaults {
94
94
exitCode = sysexits . NOPERM ;
95
95
}
96
96
97
+ class ErrorVaultsNameConflict extends ErrorVaults {
98
+ description = 'Unique name could not be created' ;
99
+ exitCode = sysexits . UNAVAILABLE ;
100
+ }
101
+
97
102
class ErrorSecrets extends ErrorPolykey { }
98
103
99
104
class ErrorSecretsSecretUndefined extends ErrorSecrets {
@@ -127,6 +132,7 @@ export {
127
132
ErrorVaultsCreateVaultId ,
128
133
ErrorVaultsMergeConflict ,
129
134
ErrorVaultsPermissionDenied ,
135
+ ErrorVaultsNameConflict ,
130
136
ErrorSecrets ,
131
137
ErrorSecretsSecretUndefined ,
132
138
ErrorSecretsSecretDefined ,
You can’t perform that action at this time.
0 commit comments