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

Misleading error message from dataset_json? #68

Closed
ehogan opened this issue Jun 16, 2016 · 4 comments
Closed

Misleading error message from dataset_json? #68

ehogan opened this issue Jun 16, 2016 · 4 comments
Milestone

Comments

@ehogan
Copy link
Contributor

ehogan commented Jun 16, 2016

Following from the comment in #25, I tried to load an incorrectly formatted JSON file:

% ipython
Python 2.7.6 (default, Jan  3 2014, 16:42:21) 
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import cmor

In [2]: cmor.setup(logfile='cmor.log')

In [3]: cmor.dataset_json('cmor_dataset.json')
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
KeyboardInterrupt: 

In [4]: cmor.close()
Out[4]: 0

In [5]: more cmor.log

C Traceback:
! In function: cmor_open_inpathFile
! called from: cmor_dataset_json
! 

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Error: Please validate JSON File!
! USE: http://jsonlint.com/
! Syntax Error in file: cmor_dataset.json
!  {

!
!!!!!!!!!!!!!!!!!!!!!!!!!


C Traceback:
! In function: cmor_dataset_json
! 

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Error: JSON resource file not found
!
!!!!!!!!!!!!!!!!!!!!!!!!!

! ------
! CMOR is now closed.
! ------
! During execution we encountered:
!   0 Warning(s)
!   2 Error(s)
! ------
! Please review them.
! ------
! 

In [6]: 

There are two errors, one of which says JSON resource file not found, even though the file was found. Is this second error message necessary?

@dnadeau4
Copy link
Collaborator

Another SIGINT problem using Python. Thanks for reporting.

@dnadeau4 dnadeau4 added this to the 3.1.0 milestone Jun 17, 2016
@dnadeau4
Copy link
Collaborator

commit in cmor_master.

@ehogan
Copy link
Contributor Author

ehogan commented Jun 21, 2016

Would it be possible for you to provide a link to the pull request / commit that contains this fix, please? Also, would it be possible for you to let me know when cmor_master will be available on master?

@dnadeau4
Copy link
Collaborator

Fixed in: db915d9

cmor-master will be available on master for tags 3.1.1, I might be merging/tagging next week depending on what else is coming up. I just got a new excel spreadsheet with all the experiment_id.

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

No branches or pull requests

2 participants