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

Verbose mode #59

Open
customcommander opened this issue Nov 13, 2021 · 0 comments
Open

Verbose mode #59

customcommander opened this issue Nov 13, 2021 · 0 comments

Comments

@customcommander
Copy link
Owner

By default the library is quite terse with regards to errors in general and validation errors specifically.

Examples

Invalid RIS content

TY  - MUSIC
TI  - Wonderwall

The parser will fail because there is no ER entry to signal the end of the record.

Writing RIS

write([{TY: ['MUSIC'], TI: 'Wonderwall'}])

This library has defined RIS record as plain JavaScript objects which keys follow the notation for tags and values are always arrays of strings. This object isn't valid and the library will ignore it and return an empty RIS file.

Errors when moving across domain

TY  - JOUR
ER  - 

This is a valid RIS file but when converted into a list of Mendeley references the library will return an empty list. Why? In Mendeley all references MUST have a type and a title which this RIS record does not. The library did convert the RIS record into a Mendeley reference but eventually discarded it because it was invalid.

Proposal

The library should still be non-verbose by default but expose a communication channel for errors e.g.

const {onError} = require('@customcommander/ris');

onError((err) => {
  // …
});
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

1 participant