~/blog

#Guide

2022 1

  • #Development #Guide

    Error handling with Either<Type>

    We have started a new small internal project for automating a few workflows around counting worked hours and time offs. The application is a slack bot on top of node js, TypeScript and PostgreSQL database. We use 3rd party APIs to fetch data about the times which we need to accumulate and process to calculate valuable information to our users. It will run on a server with a possibility of migrating into serverless when we decide if it’s a good use case for it. We’ve decided that we won’t experiment too much for development as we want to make it useful first. As it is not a classic web server application I had to come up with slightly different error handling as we are used to. I’ve been trying to find a semi-functional API with all the good practices described in my guide on error handling. The main goal is to not let users be presented with internal information about errors. We want to show user-friendly messages instead.

2020 2

  • #Development #Guide

    Logging recommendations

    Do not use console directly. Programs should be able to define logging strategies dependant on the environment. We strongly recommend using a logging library such as Winston (commonly used in node.js programs). Libraries should provide an easy way to choose a transport which will be used as on output for logs. Examples of transports:

  • #Development #Guide

    Guide on error handling

    Having good error handling practice is very important when building complex applications. Applications which consist of multiple applications such as web applications, where you have multiple parts like client, server and database create a system where errors can happen in any individual parts or in communication between them.

↑ top