Iain Collins
Iain Collins

Aug 13, 2018

·
6 min read
·

Better error handling in JavaScript

How and why to use custom error types in JavaScript

Handling errors well can be tricky. How Error() historically worked in JavaScript hasn’t made this easier, but using the Error class introduced in ES6 can be helpful

Image © Quinn Dombrowski

Throwing errors in JavaScript

--

--

More from Iain Collins

Recommended from Medium

Aanchal Patial

Aanchal Patial

Day 11 of June LeetCode Challenge

The Educative Team

The Educative Team

in

CodeX

React Tutorial: How to build the Instagram UI with React

Pizzaboy

Pizzaboy

GRPC Unary — NodeJS & Golang

Aaron Bruce

Aaron Bruce

in

To Err is Aaron

Detect Network Failures When Using Fetch

Sean McPherson

Sean McPherson

Understanding and organizing dependencies in node packages

Monica Gerard

Monica Gerard

React: what is the useRef() hook?

Mr. Ahsan

Mr. Ahsan

Learn React.js (Rendering Elements) — 2

Don Mallory

Don Mallory

Look at Me!!! Ensure Your Users See Your Tooltips With This Fun React / Material UI Snippet

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Get unlimited access
Iain Collins

Iain Collins

861 Followers

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech