Skip to content

Commit b5bcbd8

Browse files
committed
Throw error when repo's version is higher then expected
License: MIT Signed-off-by: Adam Uhlir <[email protected]>
1 parent 8a19b3b commit b5bcbd8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,12 @@ class IpfsRepo {
293293

294294
const currentRepoVersion = await this.version.get()
295295
log(currentRepoVersion)
296-
if (currentRepoVersion >= toVersion) {
297-
if (currentRepoVersion > toVersion) {
298-
log('Your repo\'s version is higher then this version of js-ipfs-repo require! You should revert it.')
299-
}
300296

297+
if (currentRepoVersion > toVersion) {
298+
throw new ERRORS.InvalidRepoVersionError('Your repo\'s version is higher then this version of js-ipfs-repo require! You have to revert it.')
299+
}
300+
301+
if (currentRepoVersion === toVersion) {
301302
log('Nothing to migrate')
302303
return
303304
}

0 commit comments

Comments
 (0)