No need for this to be a class, an object is fine. Also throw the errorinstead of catching it and console logging it.