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

class Car{}

class Seller {
    cars: Car[] = []

    sell() {
        if (this.cars.length === 0) {
            throw "No cars for sale"
        }
        //some implementation...
    }        
}

var seller = new Seller()
seller.sell()