Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make 'reference to a non-existent schema item <id>' an ISE #6314

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions edb/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ def _get_by_id(
sclass_name = self._id_to_type[obj_id]
except KeyError:
if default is so.NoDefault:
raise errors.InvalidReferenceError(
raise LookupError(
f'reference to a non-existent schema item {obj_id}'
f' in schema {self!r}'
) from None
Expand All @@ -1322,7 +1322,7 @@ def _get_by_id(
else:
obj = so.Object.schema_restore((sclass_name, obj_id))
if type is not None and not isinstance(obj, type):
raise errors.InvalidReferenceError(
raise TypeError(
f'schema object {obj_id!r} exists, but is a '
f'{obj.__class__.get_schema_class_displayname()!r}, '
f'not a {type.get_schema_class_displayname()!r}'
Expand Down