Skip to content

Commit e96e381

Browse files
authored
Correctly catch async exceptions in FileSystemDataVault (#9016)
Got a ton of exception warnings in the logs because the exceptions weren’t correctly captured into the Fox. Fox.fromFutureBox assumes that there is no exception in the future itself. This is not what is needed here.
1 parent 20e3838 commit e96e381

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webknossos-datastore/app/com/scalableminds/webknossos/datastore/datavault/FileSystemDataVault.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ class FileSystemDataVault extends DataVault with FoxImplicits {
7474
if (channel != null && channel.isOpen) channel.close()
7575
}
7676

77-
Fox.fromFutureBox(promise.future)
77+
for {
78+
box <- Fox.fromFuture(promise.future)
79+
result <- box.toFox
80+
} yield result
7881
}
7982

8083
override def listDirectory(path: VaultPath, maxItems: Int)(implicit ec: ExecutionContext): Fox[List[VaultPath]] =

0 commit comments

Comments
 (0)