// create throwing function using throws keyword func division(numerator: Int, denominator: Int) throws { // throw error if divide by 0 if denominator == 0 { throw DivisionError.dividedByZero } ... }