try catch around Object.keys(err)