Skip to content

Commit 5b694b8

Browse files
committed
return ShuttingDown error from registry instead of panic
1 parent e6939f8 commit 5b694b8

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

libsql-wal/src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub enum Error {
1717
InvalidHeaderVersion,
1818
#[error("Invalid page size, only 4095 is supported")]
1919
InvalidPageSize,
20+
#[error("Registry is shutting down")]
21+
ShuttingDown,
2022
}
2123

2224
impl Into<libsql_sys::ffi::Error> for Error {

libsql-wal/src/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ where
166166
namespace: &NamespaceName,
167167
) -> Result<Arc<SharedWal<IO>>> {
168168
if self.shutdown.load(Ordering::SeqCst) {
169-
todo!("open after shutdown");
169+
return Err(crate::error::Error::ShuttingDown);
170170
}
171171

172172
loop {

0 commit comments

Comments
 (0)