Skip to content

Commit

Permalink
feat: update error message (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-martacarlos authored and OS-ricardomoreirasilva committed Apr 10, 2024
1 parent 6d12436 commit 42b678a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

The changes documented here do not include those from the original repository.

## [Unreleased]

- Chore: Update cordova hooks with new OutSystems specific errors. (https://outsystemsrd.atlassian.net/browse/RMET-3311)

## [Version 1.1.2]

### 21-12-2023
Expand Down
10 changes: 5 additions & 5 deletions hooks/android/androidCopyPreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ module.exports = function (context) {
jsonParsed = JSON.parse(jsonConfigFile);
}
catch {
throw new Error("Missing configuration file or error trying to obtain the configuration.");
throw new Error("OUTSYSTEMS_PLUGIN_ERROR: Missing configuration file or error trying to obtain the configuration.");
}

jsonParsed.app_configurations.forEach(function(configItem) {
jsonParsed.app_configurations.forEach((configItem) => {
if (configItem.service_id == ServiceEnum.GooglePay) {
hasGooglePay = true;
var error_list = [];
let error_list = [];

if(configItem.merchant_name && configItem.merchant_name !== ""){
merchant_name = configItem.merchant_name;
Expand Down Expand Up @@ -109,9 +109,9 @@ module.exports = function (context) {
}

if (error_list.length > 0) {
throw new Error("The following fields are either missing or empty in the configuration: " + error_list);
console.error("Missing fields: " + error_list);
throw new Error("OUTSYSTEMS_PLUGIN_ERROR: Payments configuration is missing some fields. Please check build logs to know more.");
}
return;
}
});

Expand Down
11 changes: 5 additions & 6 deletions hooks/ios/iOSCopyPreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ module.exports = function (context) {
let jsonConfigFile = fs.readFileSync(jsonConfig, 'utf8');
jsonParsed = JSON.parse(jsonConfigFile);
} catch {
throw new Error("Missing configuration file or error trying to obtain the configuration.");
throw new Error("OUTSYSTEMS_PLUGIN_ERROR: Missing configuration file or error trying to obtain the configuration.");
}

jsonParsed.app_configurations.forEach(function(configItem) {
jsonParsed.app_configurations.forEach((configItem) => {
if (configItem.service_id == ServiceEnum.ApplePay) {
var error_list = [];
let error_list = [];

if (configItem.merchant_id != null && configItem.merchant_id !== "") {
merchant_id = configItem.merchant_id;
Expand Down Expand Up @@ -102,10 +102,9 @@ module.exports = function (context) {
}

if (error_list.length > 0) {
throw new Error("Configuration is missing the following fields: " + error_list);
console.error("Missing fields: " + error_list);
throw new Error("OUTSYSTEMS_PLUGIN_ERROR: Payments configuration is missing some fields. Please check build logs to know more.");
}

return;
}
});

Expand Down

0 comments on commit 42b678a

Please sign in to comment.