question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How should isHealthy behave on errors

See original GitHub issue

Problem

isHealthy only returns true or throws an error.

How it works

As of today the isHealthy method returns true if the request and response are successful. In case any of request or response fails, the error is thrown and the user has to catch it.

Suggestion

As of this PR #635 EDIT There are three possible scenarios:

  • Request and response are successful: isHealthy returns true
  • Response returns an error with error code maintenance: isHealthy returns
  • Response and or response fails (not maintenance as errorCode): isHealthy throws an error

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
curquizacommented, Oct 19, 2020

FYI, this MeiliSearch’s issue https://github.com/meilisearch/MeiliSearch/issues/940 changes the not-idomatic behavior of /health route: it would always return a 204 if you success to reach MeiliSearch via this route (if I understand well). It would be the job of the SDK to return true if you get the 204 and false if you don’t get anything at all because the MeiliSearch’s server is unreachable.

Edit: FYI, the changes about this route has been merged and will be present in the next release at the beginning of November.

0reactions
bidoubiwacommented, Oct 20, 2020

In the pr of @neupauer when MeiliSearch server is unreachable an error is thrown, like it is now. false only appeared when we were in maintenance. But this is not possible anymore, so we should never expect a false.

Unless we decide that the user should not be aware of why the server is not healthy and just return false?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Behaviors and Errors
In a just culture all types of error hold equal importance because they are seen as an opportunity for the organization to learn...
Read more >
Shaping a Reliable Culture of Safety: Our Error Prevention ...
▫All of us make mistakes/errors. ▫When people in healthcare make mistakes, it can result in great inconvenience, harm or death.
Read more >
Medical Error Reduction and Prevention - StatPearls - NCBI
Preventable medical errors contribute substantially to healthcare costs, including higher health insurance costs per person expenses. Only by ...
Read more >
Learning from Errors | Annual Review of Psychology
Interestingly, the beneficial effects are particularly salient when individuals strongly believe that their error is correct: Errors committed with high ...
Read more >
Preventing Medical Errors: Best Practices for Mental Health ...
Are you a psychologist looking for our medical errors course? ... Health Insurance Portability Accountability Act. Confidentiality.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found