Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling errors when opening store #28

Open
shmish111 opened this issue Oct 28, 2015 · 1 comment
Open

Handling errors when opening store #28

shmish111 opened this issue Oct 28, 2015 · 1 comment

Comments

@shmish111
Copy link
Contributor

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.

@owainlewis
Copy link
Owner

Hi,

In this case I'd agree that not catching the error is the most sensible thing as nothing else can go ahead from this point on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants