Skip to content

Catch convert errors and warnings #102

@simeonackermann

Description

@simeonackermann

Issue type: 🦄 Feature

Description

Currently its not possible to catch yarrrml2rml convert errors and warnings. My idea was to simply log these messages and return them if requested. I think its better then throw errors and exit the conversion, because we may want ignore the warnings.
I don't really know how others solve this issue, but I simply solved it for me with a static logger (based on js-logger) on my fork: https://github.com/simeonackermann/yarrrml-parser/tree/feature-logger

Usage is:

const y2r = new yarrrml();
...
if ( y2r.getLogger().has('error') ) {
   const logs = y2r.getLogger().getAll();
   ...
}

Shall I open a PR for this?

Existing features it breaks

nothing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions