Skip to content

If Relaton gem sees any load error or yaml error in the cached index (or any cached documents), it should consider the cache as corrupt and wipe it #112

@ronaldtse

Description

@ronaldtse

From relaton/relaton-bipm#45

If Relaton gem sees any load error or yaml error in the cached index (or any cached documents), it should consider the cache as corrupt and wipe it.

Right now, on load error or YAML parsing errors, the Relaton gems will just crash. Crashing is never acceptable behavior. We should tell the users why it's crashing, and if it's crashing, tell the user what we will do to mitigate this.

e.g. if redownload successful

[relaton] YAML parsing error when reading file ~/.relaton/bipm/index.yaml
[relaton] Considering ~/.relaton/bipm/index.yaml file corrupt, re-downloading from https://github.com/relaton/relaton-data-bipm/xxx
[relaton] Loaded index from ~/.relaton/bipm/index.yaml

e.g. if remote index is also corrupt

[relaton] YAML parsing error when reading file ~/.relaton/bipm/index.yaml
[relaton] Considering ~/.relaton/bipm/index.yaml file corrupt, re-downloading from https://github.com/relaton/relaton-data-bipm/xxx
[relaton] YAML parsing error when reading newly downloaded file at ~/.relaton/bipm/index.yaml , the remote index seems to be broken. Please report this issue at https://github.com/relaton/relaton-cli.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions