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

Improve Ipyannotator API message error #51

Open
itepifanio opened this issue Sep 22, 2022 · 0 comments
Open

Improve Ipyannotator API message error #51

itepifanio opened this issue Sep 22, 2022 · 0 comments

Comments

@itepifanio
Copy link
Collaborator

Ipyannotator has an API to use its previously defined annotators. The API uses a pair of input/output and when this pair it's not configured the API should throw a friendly exception for the user.

Right now when a pair it's not correctly configured the API prints a friendly message (Pair (Annotator Input type: CustomInput, Annotator Output type: NoOutput) is not supported!) but also throws a random exception AttributeError: 'NoneType' object has no attribute 'get_annotator' this behavior can be reproduced using the following code:

from ipyannotator.mltypes import Input, Output
from ipyannotator.annotator import Annotator

class CustomInput(Input):
    pass

custom_input = CustomInput()
annotator = Annotator(custom_input)
annotator.explore()

The expected behavior it's:

  • Ipyannotator throws a friendly custom exception (ex. PairUnsupported)
  • Don't throw the AttributeError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants