We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57c59e5 commit c650765Copy full SHA for c650765
1 file changed
datajoint/external.py
@@ -8,7 +8,7 @@
8
from .table import Table, FreeTable
9
from .heading import Heading
10
from .declare import EXTERNAL_TABLE_ROOT
11
-from . import s3
+from . import s3, errors
12
from .utils import safe_write, safe_copy
13
14
logger = logging.getLogger(__name__.split(".")[0])
@@ -141,7 +141,12 @@ def _download_buffer(self, external_path):
141
if self.spec["protocol"] == "s3":
142
return self.s3.get(external_path)
143
if self.spec["protocol"] == "file":
144
- return Path(external_path).read_bytes()
+ try:
145
+ return Path(external_path).read_bytes()
146
+ except FileNotFoundError:
147
+ raise errors.MissingExternalFile(
148
+ f"Missing external file {external_path}"
149
+ ) from None
150
assert False
151
152
def _remove_external_file(self, external_path):
0 commit comments