Failure to cast Family Controls Error to FamilyControlsError

When asking for ScreenTime permission from users, were are seeing cases where

guard let error = error as? FamilyControlsError else {           
     print(String(describing: error)
     print("\n")
     print(error.localizedDescription)
     return
}

prints

Error Domain=FamilyControls.FamilyControlsError Code=5 "(null)"

The operation couldn’t be completed. (FamilyControls.FamilyControlsError error 5.)

We've also seen this with error code 4 and 7. Why are these failing to cast to FamilyControlsError?

hey ! We opened a radar for this a while ago, but it seems to have been fixed on iOS 16.4, are you testing on an iOS 16.4+ device ?

That's helpful thanks - we are seeing it in prod in pre-16.4 cases. I'm seeing cases of it popping back up in 16.6 as well so there may have been a regression

Failure to cast Family Controls Error to FamilyControlsError
 
 
Q