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

Need a more clear error message for manifest.json issues #365

Open
newgene opened this issue Dec 5, 2024 · 0 comments
Open

Need a more clear error message for manifest.json issues #365

newgene opened this issue Dec 5, 2024 · 0 comments
Assignees

Comments

@newgene
Copy link
Member

newgene commented Dec 5, 2024

For some common issues in a manifest.json file, the CLI currently returns some errors which are not very straightforward to the end users. We should try to catch these issues early and return something more useful.

Here is an example data plugin:

There are two issues:

  1. uploaders should be uploader here, otherwise, uploaders should expect an array as the value.
  2. the parser module name is incorrectly referenced: "parser": "mAb_parser:load_data", , the value should be parser:load_data.

The current error for the first one:

[13:24:17] ERROR    Invalidate plugin 'mAbsData' because: Error loading manifest: 'str' object has no attribute 'get'                                                                
                    Traceback (most recent call last):                                                                                                                               
                      File "/.../biothings.api/biothings/hub/dataplugin/assistant.py", line 169, in load_plugin                                                           
                        self.interpret_manifest(manifest, df.as_posix())                                                                                                             
                    AttributeError: 'str' object has no attribute 'get' 

The 2nd one returns this error:

           ERROR    Invalidate plugin 'mAbsData' because: Error loading manifest: load_data not found in module <module 'mAbsData' (namespace) from ['/tmp/mAbsData']>     
                    Traceback (most recent call last):                                                                                                                               
                      File "/.../biothings.api/biothings/hub/dataplugin/assistant.py", line 169, in load_plugin                                                           
                        self.interpret_manifest(manifest, df.as_posix())                                                                                                             
                    AssertionError: load_data not found in module <module 'mAbsData' (namespace) from ['/tmp/mAbsData']> 

This error is actually not too bad, at least it points out an invalid mAbsData module correctly. We can see if any room to improve this one as well.

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