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.