Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RMET-3311 :: Hook :: Update Error #37

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading