"examples/vscode:/vscode.git/clone" did not exist on "d457beed92e768af6090238962a93c4cf4792e8f"
Commit 5359a289 authored by Hongkun Yu's avatar Hongkun Yu Committed by A. Unique TensorFlower
Browse files

Update error messages of registry to make the instruction more clear.

PiperOrigin-RevId: 389025611
parent 136c168c
...@@ -87,11 +87,15 @@ def lookup(registered_collection, reg_key): ...@@ -87,11 +87,15 @@ def lookup(registered_collection, reg_key):
for h_idx, entry_name in enumerate(hierarchy): for h_idx, entry_name in enumerate(hierarchy):
if entry_name not in collection: if entry_name not in collection:
raise LookupError( raise LookupError(
"collection path {} at position {} never registered.".format( f"collection path {entry_name} at position {h_idx} is never "
entry_name, h_idx)) f"registered. Please make sure the {entry_name} and its library is "
"imported and linked to the trainer binary.")
collection = collection[entry_name] collection = collection[entry_name]
return collection return collection
else: else:
if reg_key not in registered_collection: if reg_key not in registered_collection:
raise LookupError("registration key {} never registered.".format(reg_key)) raise LookupError(
f"registration key {reg_key} is never "
f"registered. Please make sure the {reg_key} and its library is "
"imported and linked to the trainer binary.")
return registered_collection[reg_key] return registered_collection[reg_key]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment