Skip to content

Handling errors when opening store #28

Description

@shmish111

Hi,

I've been having a problem when dealing with a store failing to open. I want to a) get the error message and b) know it's an error. At the moment a failure to open a store returns a string. I could test the type that is returned but I feel it's quite clunky and a bit old skool. To me the options are:

  1. Don't catch the error
  2. Use some sort of Either type
  3. Log the error and return nil

Currently I think I would prefer to not catch the error; opening the store is something that I would expect to be done quite early on, for example I open a store in my main method. I would be happy to catch the Exception along with any other possibles as I start my program as it is a fatal error. What do you think? Let me know and I can create a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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