Skip to content

Commit

Permalink
chore(af): update error message to make it more understandable (#2285)
Browse files Browse the repository at this point in the history
* chore: update error message to make it more clear

* chore: update error message

---------

Co-authored-by: Krishna Chaitanya <[email protected]>
  • Loading branch information
ujjwal-ab and krishna2020 committed Jun 20, 2023
1 parent d046cd2 commit 50f07d3
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/v0/destinations/af/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function responseBuilderSimple(payload, message, destination) {
} else if (os && isAppleFamily(os) && appleAppId) {
endpoint = `${ENDPOINT}id${appleAppId}`;
} else {
throw new ConfigurationError('Invalid app endpoint');
throw new ConfigurationError(
'os name is required along with the respective appId eg. (os->android & Android App Id is required) or (os->ios & Apple App Id is required)',
);
}
// if (androidAppId) {
// endpoint = `${ENDPOINT}${androidAppId}`;
Expand Down
64 changes: 64 additions & 0 deletions test/__tests__/data/af_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,5 +1011,69 @@
},
"Enabled": true
}
},
{
"message": {
"channel": "web",
"context": {
"externalId": [
{
"type": "appsflyerExternalId",
"id": "afUid"
}
],
"app": {
"build": "1.0.0",
"name": "RudderLabs JavaScript SDK",
"namespace": "com.rudderlabs.javascript",
"version": "1.0.0"
},
"traits": {
"email": "[email protected]",
"name": "Test Hubspot",
"anonymousId": "12345"
},
"library": {
"name": "RudderLabs JavaScript SDK",
"version": "1.0.0"
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36",
"locale": "en-GB",
"ip": "0.0.0.0",
"os": {
"name": "",
"version": ""
},
"screen": {
"density": 2
}
},
"type": "page",
"messageId": "e8585d9a-7137-4223-b295-68ab1b17dad7",
"originalTimestamp": "2019-10-15T09:35:31.289Z",
"anonymousId": "00000000000000000000000000",
"userId": "12345",
"properties": {
"path": "",
"referrer": "",
"search": "",
"title": "",
"url": ""
},
"name": "ApplicationLoaded",
"sentAt": "2019-10-14T11:15:53.296Z",
"integrations": {
"AF": {
"af_uid": "afUid"
}
}
},
"destination": {
"Config": {
"devKey": "ef1d42390426e3f7c90ac78272e74344",
"androidAppId": "com.rudderlabs.javascript"
},
"Enabled": true
}
}
]
4 changes: 4 additions & 0 deletions test/__tests__/data/af_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,5 +349,9 @@
"FORM": {}
},
"files": {}
},
{
"statusCode": 400,
"error": "os name is required along with the respective appId eg. (os->android & Android App Id is required) or (os->ios & Apple App Id is required)"
}
]

0 comments on commit 50f07d3

Please sign in to comment.