diff --git a/lib/extensions/permissions.js b/lib/extensions/permissions.js index 3e76314..72c7f8e 100644 --- a/lib/extensions/permissions.js +++ b/lib/extensions/permissions.js @@ -175,7 +175,7 @@ async function setAccess (bundleId, permissionsMapping) { resetPermissions.push(serviceName); break; default: - this.log.errorAndThrow( + throw this.log.errorWithException( `${serviceName} does not support ${permissionsMapping[serviceName]}. Please specify 'yes', 'no' or 'unset'.` ); } diff --git a/lib/extensions/settings.js b/lib/extensions/settings.js index 2088ded..6501f8f 100644 --- a/lib/extensions/settings.js +++ b/lib/extensions/settings.js @@ -357,7 +357,7 @@ export function verifyDevicePreferences (prefs = {}) { if (!_.isUndefined(prefs.SimulatorWindowLastScale)) { if (!_.isNumber(prefs.SimulatorWindowLastScale) || prefs.SimulatorWindowLastScale <= 0) { - this.log.errorAndThrow(`SimulatorWindowLastScale is expected to be a positive float value. ` + + throw this.log.errorWithException(`SimulatorWindowLastScale is expected to be a positive float value. ` + `'${prefs.SimulatorWindowLastScale}' is assigned instead.`); } } @@ -366,7 +366,7 @@ export function verifyDevicePreferences (prefs = {}) { // https://regex101.com/r/2ZXOij/2 const verificationPattern = /{-?\d+(\.\d+)?,-?\d+(\.\d+)?}/; if (!_.isString(prefs.SimulatorWindowCenter) || !verificationPattern.test(prefs.SimulatorWindowCenter)) { - this.log.errorAndThrow(`SimulatorWindowCenter is expected to match "{floatXPosition,floatYPosition}" format (without spaces). ` + + throw this.log.errorWithException(`SimulatorWindowCenter is expected to match "{floatXPosition,floatYPosition}" format (without spaces). ` + `'${prefs.SimulatorWindowCenter}' is assigned instead.`); } } @@ -374,14 +374,14 @@ export function verifyDevicePreferences (prefs = {}) { if (!_.isUndefined(prefs.SimulatorWindowOrientation)) { const acceptableValues = ['Portrait', 'LandscapeLeft', 'PortraitUpsideDown', 'LandscapeRight']; if (!prefs.SimulatorWindowOrientation || !acceptableValues.includes(prefs.SimulatorWindowOrientation)) { - this.log.errorAndThrow(`SimulatorWindowOrientation is expected to be one of ${acceptableValues}. ` + + throw this.log.errorWithException(`SimulatorWindowOrientation is expected to be one of ${acceptableValues}. ` + `'${prefs.SimulatorWindowOrientation}' is assigned instead.`); } } if (!_.isUndefined(prefs.SimulatorWindowRotationAngle)) { if (!_.isNumber(prefs.SimulatorWindowRotationAngle)) { - this.log.errorAndThrow(`SimulatorWindowRotationAngle is expected to be a valid number. ` + + throw this.log.errorWithException(`SimulatorWindowRotationAngle is expected to be a valid number. ` + `'${prefs.SimulatorWindowRotationAngle}' is assigned instead.`); } }