Handling the try/catch and if/else hell

Cleaner code thanks to Tiinvo, a Functional Programming library for JavaScript and TypeScript.