Skip to content

Commit 6ae989e

Browse files
committed
[FIX] fs_storage: Add a KeyError Exception
This is necessary in order to avoid issues in case fsspec added a new protocol and forget the error key
1 parent 0b2548f commit 6ae989e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs_storage/models/fs_storage.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ def _get_protocols(self) -> list[tuple[str, str]]:
242242
protocol.append((p, f"{p} ({cls.__name__})"))
243243
except ImportError as e:
244244
_logger.debug("Cannot load the protocol %s. Reason: %s", p, e)
245+
except KeyError as e:
246+
_logger.debug("Cannot load the protocol %s. Reason: %s", p, e)
245247
return protocol
246248

247249
@api.constrains("options")
@@ -276,6 +278,8 @@ def _get_options_protocol(self) -> list[tuple[str, str]]:
276278
protocol.append((p, p))
277279
except ImportError as e:
278280
_logger.debug("Cannot load the protocol %s. Reason: %s", p, e)
281+
except KeyError as e:
282+
_logger.debug("Cannot load the protocol %s. Reason: %s", p, e)
279283
return protocol
280284

281285
@api.depends("options_protocol")

0 commit comments

Comments
 (0)