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

Raise RuntimeError when MeTTa extension is loaded with error #549

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

vsbogd
Copy link
Collaborator

@vsbogd vsbogd commented Jan 26, 2024

This is fast fix to raise an error when erroneous extension is loaded:

from hyperon.ext import register_atoms

@register_atoms
def my_atoms():
    return {
        'multi-sum': NonExistingAtom()
    }

Right now error is too verbose because the whole stack is added in hyperonpy.cpp. To avoid it and return only message sent by user we need to introduce custom exception class to be able to distinguish it from other RuntimeErrors.

@vsbogd vsbogd merged commit 664e6ba into trueagi-io:main Jan 26, 2024
1 of 2 checks passed
@vsbogd vsbogd deleted the error-extension branch January 26, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants