Skip to content

Commit 15a8b9f

Browse files
committed
fix: rename ErrSnapshotNotExists to ErrSnapshotDoesNotExist
1 parent cff7a39 commit 15a8b9f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Database/LSMTree/Internal.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ data LSMTreeError =
209209
-- the idempotent operation 'Database.LSMTree.Common.closeCursor'.
210210
| ErrCursorClosed
211211
| ErrSnapshotExists SnapshotName
212-
| ErrSnapshotNotExists SnapshotName
212+
| ErrSnapshotDoesNotExist SnapshotName
213213
| ErrSnapshotDeserialiseFailure DeserialiseFailure SnapshotName
214214
| ErrSnapshotWrongTableType
215215
SnapshotName
@@ -1294,7 +1294,7 @@ openSnapshot sesh label tableType override snap resolve = do
12941294
-- Guard that the snapshot exists
12951295
let snapDir = Paths.namedSnapshotDir (sessionRoot seshEnv) snap
12961296
FS.doesDirectoryExist hfs (Paths.getNamedSnapshotDir snapDir) >>= \b ->
1297-
unless b $ throwIO (ErrSnapshotNotExists snap)
1297+
unless b $ throwIO (ErrSnapshotDoesNotExist snap)
12981298

12991299
let SnapshotMetaDataFile contentPath = Paths.snapshotMetaDataFile snapDir
13001300
SnapshotMetaDataChecksumFile checksumPath = Paths.snapshotMetaDataChecksumFile snapDir
@@ -1360,7 +1360,7 @@ deleteSnapshot sesh snap = do
13601360
let snapDir = Paths.namedSnapshotDir (sessionRoot seshEnv) snap
13611361
doesSnapshotExist <-
13621362
FS.doesDirectoryExist (sessionHasFS seshEnv) (Paths.getNamedSnapshotDir snapDir)
1363-
unless doesSnapshotExist $ throwIO (ErrSnapshotNotExists snap)
1363+
unless doesSnapshotExist $ throwIO (ErrSnapshotDoesNotExist snap)
13641364
FS.removeDirectoryRecursive hfs (Paths.getNamedSnapshotDir snapDir)
13651365

13661366
{-# SPECIALISE listSnapshots :: Session IO h -> IO [SnapshotName] #-}

test/Test/Database/LSMTree/StateMachine.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ lsmTreeErrorHandler = Handler $ pure . handler'
489489
handler' :: LSMTreeError -> Maybe Model.Err
490490
handler' ErrTableClosed = Just Model.ErrTableClosed
491491
handler' ErrCursorClosed = Just Model.ErrCursorClosed
492-
handler' (ErrSnapshotNotExists _snap) = Just Model.ErrSnapshotDoesNotExist
492+
handler' (ErrSnapshotDoesNotExist _snap) = Just Model.ErrSnapshotDoesNotExist
493493
handler' (ErrSnapshotExists _snap) = Just Model.ErrSnapshotExists
494494
handler' ErrSnapshotWrongTableType{} = Just Model.ErrSnapshotWrongType
495495
handler' (ErrBlobRefInvalid _) = Just Model.ErrBlobRefInvalidated

test/Test/Database/LSMTree/UnitTests.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ unit_snapshots =
133133
withSession nullTracer hfs hbio (FS.mkFsPath []) $ \sess -> do
134134
table <- new @_ @Key1 @Value1 @Blob1 sess defaultTableConfig
135135

136-
assertException (ErrSnapshotNotExists snap2) $
136+
assertException (ErrSnapshotDoesNotExist snap2) $
137137
deleteSnapshot sess snap2
138138

139139
createSnapshot label1 snap1 table
@@ -146,7 +146,7 @@ unit_snapshots =
146146
_ <- openSnapshot @_ @Key2 @Value2 @Blob2 sess configNoOverride label2 snap1
147147
return ()
148148

149-
assertException (ErrSnapshotNotExists snap2) $ do
149+
assertException (ErrSnapshotDoesNotExist snap2) $ do
150150
_ <- openSnapshot @_ @Key1 @Value1 @Blob1 sess configNoOverride label2 snap2
151151
return ()
152152
where

0 commit comments

Comments
 (0)