I try to implement insert as user and catch fields that user has no access to them but I face with problem that method does not exist.
try { update as user items; } catch(DMLException e) { System.debug(e.getFieldNames()); } error message that I get during deployment is Method does not exist or incorrect signature: void getFieldNames() from the type System.DmlException
According to SF documentation it should work but I haven't found any working examples in Google https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_enforce_usermode.htm
Any hints how I can make it work by using update as user and not Database.update()?

