Skip to content

set() should not silently ignore exceptions #37

@dispyfree

Description

@dispyfree

Hi,

the set function, as it is currently implemented, simply gulps down all exceptions:

function set (key, value) {
  try {
    ls.setItem(key, JSON.stringify(value));
    return true;
  } catch (e) {
    return false;
  }
}
  • the function should either not catch exceptions (breaking change)
  • or at least log exceptions to the console.

Actively suppressing exceptions decreases visibility into the fact that errors are happening at all and makes debugging harder.

Cheer,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions