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

Clear error massages about "project" input #15

Open
yanirmr opened this issue Oct 23, 2022 · 2 comments
Open

Clear error massages about "project" input #15

yanirmr opened this issue Oct 23, 2022 · 2 comments
Labels
⭐️ Enhancement New feature or request

Comments

@yanirmr
Copy link

yanirmr commented Oct 23, 2022

Hi,

Thank you again for this useful package.

I have a small suggestion about error messages.

In some methods, there is a "project" parameter that supports project objects or project identifiers. It is not clear why I am trying to send and receive data by project name, but I am unable to do so. Unfortunately, this feature is not supported.

It may not be a smart idea at all to obtain data by project name. However, the current error message is not clear enough and it may be beneficial to convert it.

When I run this code:

pycaprio_client = Pycaprio("some-url", ('user', 'pass'))
zip_content = pycaprio_client.api.export_project("project-name", InceptionFormat.UIMA_CAS_XMI)

This is the error:

pycaprio.core.exceptions.InceptionBadResponse: HTTP 500: {"messages":[{"level":"ERROR","message":"Internal server error: Failed to convert value of type 'java.lang.String' to required type 'long'; nested exception is java.lang.NumberFormatException: For input string: \"project-name\""}]}
@reckart
Copy link
Member

reckart commented Oct 24, 2022

INCEpTION currently only supports exporting projects by ID, not by slug.

See also: inception-project/inception#3457

@yanirmr
Copy link
Author

yanirmr commented Oct 24, 2022

Thank you @reckart
About the INCEpTION side - I support @jcklie 's suggestion.
See the walk-around in inceptalytics for this issue here

To solve Pycaprio's issue, I suggest clearing the Pythonic API error message instead of the original Java error message. The current situation does not appear to be intuitive to me.

@reckart reckart added the ⭐️ Enhancement New feature or request label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐️ Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants