do {
// Create audio player object
audioPlayer = try AVAudioPlayer(contentsOf: soundURL)
// Play the sound
audioPlayer?.play()
}
catch {
// Couldn't create audio player object, log the error
print("Couldn't create the audio player for file (soundFilename)")
}
do {
try division(numerator: 10, denominator: 0)
...
}
catch DivisionError.dividedByZero {
// statement
}
var numerator = 10
var denominator = 0
// try to divide a number by 0
var result = numerator / denominator // error code