I love Lodash, but I’m not here to tell you to use Lodash. It’s up to you to decide if a tool is useful for you or your project. It will come down to the n...
Handling Errors... or not
You know that you should handle your exceptions, right. Sometimes you remember to and sometimes you don’t. When you don’t, do you feel a bit guilty that you’re not being a “good” or “professional” programmer? What would it look like if you handled every single exception in your code? It would probably be bloated and hard to maintain. When and why should we handle exceptions?
JS NOTE: I thought at first that
catch would get the error but the promise chain would still allow other
catch calls. It makes sense that it doesn’t, otherwise you wouldn’t be able to choose to either handle an error or let it bubble.
NOTE: Logging errors depends on the quality of the code doing the logging. If somebody writes:
logger.error('call failed') you won’t see the error message to know why. If somebody writes
logger.error('service call error: ' + err.message), that is better, but you don’t know which service and you don’t have a stack trace. This is why exception have the ability to “bubble”. It is a standard way to pass all that information up so that it can be logged / sent off / etc… in a standard way.
That doesn’t mean you should just let errors happen. Attaching your business logic’s context can be very useful in seeing immediately where an error came from. Ideally you would do that in a standard way to reduce the need to dig through the code to find where the error came from
- Logging is useful for debugging, but it isn’t in-your-face. We’re not always looking at logs
Exception tracking is better. In-your-face. Sends E-Mails/Slack message/etc… Lets you organize your errors
- Functions at a “lower level” which handle their errors (and log, or just simply return a fake value) make errors hard to see
- Need to distinguish between something that you expect to happen and you’re OK with a default value, and something that you don’t expect and really need to know about
- Lat/long of 0,0 is rarely acceptable. Don’t return 0/empty string/etc… if you don’t know what the value should be
Discuss “Functional Core, Imperative Shell” (?)
- Investigate: https://jamesonzimmer.com/dynamic-footnotes-markdown-jekyll-no-plugin/
- Look again at Exceptional Ruby
- Catching errors early means that they can’t be caught and dealt with by higher, more general, logging / exception reporting handlers
- I wrote some stuff in my notebook
- Use multiple languages? or just pseudo code?
I’ve mix phx.new ed many applications and when doing so I often start with wondering how to organize my code. I love how Phoenix pushes you to think about th...
For just over a year I’ve been obsessed on-and-off with a project ever since I stayed in the town of Skibbereen, Ireland. Taking data from the 1901 and 1911...
A while ago my colleague Michael suggested to me that I draw out some examples of how my record linkage algorithm did it’s thing. In order to do that, I’ve ...
Last night I ran a very successful workshop at the Friends of Neo4j Stockholm meetup group. The format was based on a workshop that I attended in San Franci...
In my last two posts I covered the process of importing data from StackOverflow and GitHub for the purpose of creating a combined MDM database. Now we get t...
In my last post I said I would “bring in another data source, show how I linked the data together, and demonstrate the sort of bigger picture that one can ge...
Joining multiple disparate data-sources, commonly dubbed Master Data Management (MDM), is usually not a fun exercise. I would like to show you how to use a g...
When using neo4j for the first time, most people want to import data from another database to start playing around. There are a lot of options including LOA...
I am he as you are he as you are me and we are all together – The Beatles
When I told the people of Northern Ireland that I was an atheist, a woman in the audience stood up and said, ‘Yes, but is it the God of the Catholics or t...
“Wilkins! Yes! I’ve considered decorating these walls with some graffiti of my own, and writing it in the Universal Character.. but it is too depressing...