Skip to content

12 improve error checking#22

Draft
pie-tras wants to merge 14 commits intomainfrom
12-improve-error-checking
Draft

12 improve error checking#22
pie-tras wants to merge 14 commits intomainfrom
12-improve-error-checking

Conversation

@pie-tras
Copy link
Copy Markdown
Contributor

Switches all prints to python logging library.

Preventive error checking:

  • In def data(), the returnType param is uppercased.
  • In def download(), the fileFormat param is checked to be one of the supported formats:
    ['asc', 'bin', 'csv', 'das', 'dds', 'dods', 'html', 'json', 'jsona', 'jsond', 'nc', 'tab', 'txt', 'zip', 'zip3']

Error handling:

  • Any LaTiS errors will be repeated through logging and provide potentially helpful information to resolve such issues.
  • There are also now sufficient checks in place for the program to continue executing after these errors occur.

Now an testErrors function in example.py that causes many of the possible errors.

Some possible examples:

[ERROR: client.py: _checkQuery: 60]: 
 Query is invalid: https://lasp.colorado.edu/lisird/latis/dap/cls_radi3o_flux_f15.csv?&time%3E%3D0
 Got: LaTiS Error: {
  DatasetNotFoundException: "Unable to find dataset: cls_radi3o_flux_f15"
}
[ERROR: client.py: _checkQuery: 60]: 
 Query is invalid: https://lasp.colorado.edu/lisird/latis/dap2/sorce_mg3_index.csv?&time%3E%3D-19023
 Got: Resource not found: /sorce_mg3_index.csv
[ERROR: client.py: _checkQuery: 60]: 
 Query is invalid: https://lasp.colorado.edu/lisird/latis/dap/cls_radio3_flux_absolute_f107.csv?232,23231&time%3E%3DA&time%3CQERWEEWD&absolute_f107%3C70&formatTime%28yyyy.MM.dd%29
 Got: LaTiS Error: {
  LatisServiceException: "Invalid Selection: could not parse 'A' as a time string."
}
[ERROR: client.py: _checkQuery: 62]: 
 Query is invalid: https://lasp.colorado.edu/lis3rd/latis/dap2/ Got: 404

@pie-tras pie-tras linked an issue Jun 21, 2023 that may be closed by this pull request
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.

Improve error checking

1 participant