---
title: "Simple and maintainable error-handling in TypeScript"
author: "Martin Hawksey"
date: 2021-06-10T20:43:51+00:00
modified: 2021-06-10T20:43:54+00:00
canonical_url: https://pulse.appsscript.info/p/2021/06/simple-and-maintainable-error-handling-in-typescript/
markdown_url: https://pulse.appsscript.info/p/2021/06/simple-and-maintainable-error-handling-in-typescript.md
categories:
  - "Advanced"
  - "Solutions"
tags:
  - "@jadelderfield"
  - "dev.to/supermetrics/"
featured_image: https://pulse.appsscript.info/files/2021/06/t5uk9esc37je7ocmx67b.png
description: "James Elderfield recently joined us on Totally Unscripted to share some insights into the infrastructure used at Supermetrics used to support the development of their Google Sheets Add-on and Data Studio Connector. As part of their stack James highlighted how they used TypeScript to write code complied to use in Google Apps Script. This post isn't Apps Script specific but provides some useful tips on using TypeScript for error handling.  "
---

# Simple and maintainable error-handling in TypeScript

![Simple and maintainable error-handling in TypeScript](https://pulse.appsscript.info/files/2021/06/t5uk9esc37je7ocmx67b.png)

> [https://dev.to/supermetrics/simple-and-maintainable-error-handling-in-typescript-56lm](https://dev.to/supermetrics/simple-and-maintainable-error-handling-in-typescript-56lm)
> Sometimes things fail — that’s a fact of life and programming. So as a programmer, you’re going to have to write error-handling code. Thankfully TypeScript has some handy features which can help us to create simple and maintainable error-handling code.

James Elderfield recently [joined us on Totally Unscripted**](https://youtu.be/dNadD91XiJ4) to share some insights into the infrastructure used at Supermetrics used to support the development of their Google Sheets Add-on and Data Studio Connector. As part of their stack James highlighted how they used TypeScript to write code complied to use in Google Apps Script. This post isn’t Apps Script specific but provides some useful tips on using TypeScript for error handling.

Source: *[Simple and maintainable error-handling in TypeScript*](https://dev.to/supermetrics/simple-and-maintainable-error-handling-in-typescript-56lm)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2021/06/simple-and-maintainable-error-handling-in-typescript/](https://pulse.appsscript.info/p/2021/06/simple-and-maintainable-error-handling-in-typescript/)*
