Skip to content

Commit

Permalink
Improve error messages when parsing the mobileprovision file
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Sep 13, 2023
1 parent 293364b commit a521c58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/idprov.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ function findIdentityFromProvisionSync (file) {
let data = fs.readFileSync(file).toString();
const b = data.indexOf('<?xml');
if (b === -1) {
throw new Error('Cannot find plist');
throw new Error('Cannot find the plist inside ' + file);
}
data = data.substring(b);
const e = data.indexOf('</plist>');
if (e === -1) {
throw new Error('Cannot find end of plist');
throw new Error('Cannot find end of plist inside ' + file);
}
const cert = plist.parse(data.substring(0, e + 8)).DeveloperCertificates.toString();
const res = tools.getIdentitiesSync();
Expand All @@ -22,7 +22,7 @@ function findIdentityFromProvisionSync (file) {
return id.hash;
}
}
throw new Error('Cannot find an identity for this mobile provisioning file.');
throw new Error('Cannot find an identity in ' + file);
}

module.exports = findIdentityFromProvisionSync;

0 comments on commit a521c58

Please sign in to comment.