Skip to content

Better log message instead: Failed to parse config (/home/noisy/.wise/config.yml) as JSON: #29

@noisy

Description

@noisy

The problem

From a perspective of a user:

steem-wise-cli | Failed to parse config (/home/noisy/.wise/config.yml) as JSON:

...looks like a bug, despite the fact that this is expected behavior and a fallback to YML format. We should display more user friendly message.

steem-wise-cli | Failed to parse config (/home/noisy/.wise/config.yml) as JSON: Unexpected token u in JSON at position 0

I did

wise --debug download-rules -a lenka ./lenka.yml

I expected to see

steem-wise-cli | Trying to read config from /home/noisy/.wise/config.json
steem-wise-cli | File config.json is not present, fallback to config.yml instead
steem-wise-cli | Trying to read config from /home/noisy/.wise/config.yml
steem-wise-cli | Successfully parsed /home/noisy/.wise/config.yml as YAML

Instead, I saw:

steem-wise-cli | Trying to read config from /home/noisy/.wise/config.yml
steem-wise-cli | Failed to parse config (/home/noisy/.wise/config.yml) as JSON: Unexpected token u in JSON at position 0
steem-wise-cli | Successfully parsed /home/noisy/.wise/config.yml as YAML

Version of steem-wise-core: 3.0.6-rc1

Version of nodejs: 10.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is neededwell definedIf you want to contribute, take task like this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions