Обработка исключений

class SimpleException { }

class RecommendExc extends Error {
    constructor(msg: string) {
        super(msg);

        // Set the prototype explicitly.
        Object.setPrototypeOf(this, 
            RecommendExc.prototype)
    }
}

throw new RecommendExc("exeption")