AVAudioSession.setActive will get NSOSStatusErrorDomain -50

When I run the following code, I occasionally get a -50 error
Code Block swift
do {
    try session.setActive(true, options: .notifyOthersOnDeactivation)
} catch {
    let ferror = NSError(domain: "set active error", code: (error as NSError).code, userInfo: ["error": error])
print(error)
}

Now because of the source code, I cannot trace it further, so I want to know what causes this error?
Thank you!!!
AVAudioSession.setActive will get NSOSStatusErrorDomain -50
 
 
Q