Skip to content

Commit c650765

Browse files
fix #1037
1 parent 57c59e5 commit c650765

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

datajoint/external.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .table import Table, FreeTable
99
from .heading import Heading
1010
from .declare import EXTERNAL_TABLE_ROOT
11-
from . import s3
11+
from . import s3, errors
1212
from .utils import safe_write, safe_copy
1313

1414
logger = logging.getLogger(__name__.split(".")[0])
@@ -141,7 +141,12 @@ def _download_buffer(self, external_path):
141141
if self.spec["protocol"] == "s3":
142142
return self.s3.get(external_path)
143143
if self.spec["protocol"] == "file":
144-
return Path(external_path).read_bytes()
144+
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
145150
assert False
146151

147152
def _remove_external_file(self, external_path):

0 commit comments

Comments
 (0)