Logger.error("\(self.TAG) faild to build audio player with error: \(error)")
owsFail("\(self.TAG) failed to build audio player with error: \(error)")
newPlayer=nil
assertionFailure()
}
returnnewPlayer
}()
@ -254,8 +253,7 @@ import AVFoundation
privatefuncplay(sound:Sound){
guardletnewPlayer=sound.playerelse{
Logger.error("\(self.TAG) unable to build player")
assertionFailure()
owsFail("\(self.TAG) unable to build player")
return
}
Logger.info("\(self.TAG) playing sound: \(sound.filePath)")
@ -355,8 +353,7 @@ import AVFoundation
}
}catch{
letmessage="\(self.TAG) in \(#function) failed to set category: \(category) mode: \(String(describing:mode)), options: \(options) with error: \(error)"
@ -919,7 +918,7 @@ protocol CallServiceObserver: class {
guardletcall=self.callelse{
//Thisshouldneverhappen;returntoaknowngoodstate.
assertionFailure("\(TAG) call was unexpectedly nil in \(#function)")
owsFail("\(TAG) call was unexpectedly nil in \(#function)")
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) call unexpectedly nil in \(#function)"))
return
}
@ -973,7 +972,7 @@ protocol CallServiceObserver: class {
guardletcall=self.callelse{
//Thisshouldneverhappen;returntoaknowngoodstate.
assertionFailure("\(TAG) call was unexpectedly nil in \(#function)")
owsFail("\(TAG) call was unexpectedly nil in \(#function)")
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) call unexpectedly nil in \(#function)"))
return
}
@ -1011,7 +1010,7 @@ protocol CallServiceObserver: class {
guardletcall=self.callelse{
//Thisshouldneverhappen;returntoaknowngoodstate.
assertionFailure("\(TAG) received data message, but there is no current call. Ignoring.")
owsFail("\(TAG) received data message, but there is no current call. Ignoring.")
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) received data message, but there is no current call. Ignoring."))
return
}
@ -1023,7 +1022,7 @@ protocol CallServiceObserver: class {
guardconnected.id==call.signalingIdelse{
//Thisshouldneverhappen;returntoaknowngoodstate.
assertionFailure("\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)")
owsFail("\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)")
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)"))
return
}
@ -1038,7 +1037,7 @@ protocol CallServiceObserver: class {
guardhangup.id==call.signalingIdelse{
//Thisshouldneverhappen;returntoaknowngoodstate.
assertionFailure("\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)")
owsFail("\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)")
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)"))
return
}
@ -1231,7 +1230,7 @@ protocol CallServiceObserver: class {