Skip to content

Commit

Permalink
style: standardized error logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Mar 2, 2017
1 parent 9f440ac commit da61e06
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion hooks/lib/android/androidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
} else if (preferences.linkDomain.indexOf('bnc.lt') !== -1) {
// bnc.lt
if (preferences.androidPrefix == null) {
throw new Error('BRANCH SDK: Missing "android-prefix" in <branch-config> in your config.xml. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Missing "android-prefix" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP')
}

intentFilterData.push(getAppLinkIntentFilterDictionary(preferences.linkDomain, preferences.androidPrefix))
Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/ios/developmentTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// pretty-json
return JSON.stringify(content, null, 2)
} catch (err) {
throw new Error('BRANCH SDK: Cannot write build.json within your root directory. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Cannot write build.json within your root directory. Docs https://goo.gl/GijGKP')
}
}

Expand All @@ -44,7 +44,7 @@
try {
return JSON.parse(content)
} catch (err) {
throw new Error('BRANCH SDK: Cannot read build.json within your root directory. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Cannot read build.json within your root directory. Docs https://goo.gl/GijGKP')
}
}

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/npm/nodeDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
installNodeModules(modules, function (err) {
if (err) {
// handle error
throw new Error('BRANCH SDK: Failed to install the Branch SDK. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Failed to install the Branch SDK. Docs https://goo.gl/GijGKP')
} else {
// only run once
setPackageInstalled(installFlagLocation)
Expand Down Expand Up @@ -59,7 +59,7 @@
// handle error
if (err) {
callback(true)
throw new Error('BRANCH SDK: Failed to install Branch node dependency ' + module + '. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Failed to install Branch node dependency ' + module + '. Docs https://goo.gl/GijGKP')
} else {
// next module
installNodeModules(modules, callback)
Expand Down
10 changes: 5 additions & 5 deletions hooks/lib/sdk/configXml.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
var configXml = xmlHelper.readXmlAsJson(pathToConfigXml)

if (configXml == null) {
throw new Error('BRANCH SDK: A config.xml is not found in project\'s root directory. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: A config.xml is not found in project\'s root directory. Docs https://goo.gl/GijGKP')
}

return configXml
Expand All @@ -38,7 +38,7 @@
var branchConfig = configXml.widget['branch-config']

if (branchConfig == null || branchConfig.length === 0) {
throw new Error('BRANCH SDK: <branch-config> tag is not set in the config.xml. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: <branch-config> tag is not set in the config.xml. Docs https://goo.gl/GijGKP')
}

return branchConfig[0]
Expand Down Expand Up @@ -91,13 +91,13 @@
// validate <branch-config> properties within config.xml
function validateBranchPreferences (preferences) {
if (preferences.bundleId === null) {
throw new Error('BRANCH SDK: Missing "widget id" in your config.xml. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Invalid "widget id" in your config.xml. Docs https://goo.gl/GijGKP')
}
if (preferences.bundleName === null) {
throw new Error('BRANCH SDK: Missing "name" in your config.xml. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Invalid "name" in your config.xml. Docs https://goo.gl/GijGKP')
}
if (preferences.branchKey === null) {
throw new Error('BRANCH SDK: Missing "branch-key" in <branch-config> in your config.xml. https://goo.gl/GijGKP')
throw new Error('BRANCH SDK: Invalid "branch-key" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP')
}
if (preferences.uriScheme === null || !/^[a-zA-Z0-9-.]*$/.test(preferences.uriScheme)) {
throw new Error('BRANCH SDK: Invalid "uri-scheme" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP')
Expand Down
4 changes: 2 additions & 2 deletions www/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ Branch.prototype.initSession = function (deepLinkDataListener) {

if (!disableGlobalListenersWarnings && !deepLinkDataListener && !window.DeepLinkHandler) {
// missing deep link data return
console.warn('BRANCH SDK: No callback in initSession and no global DeepLinkHandler method. No Branch deep link data will be returned. https://goo.gl/GijGKP')
console.warn('BRANCH SDK: No callback in initSession and no global DeepLinkHandler method. No Branch deep link data will be returned. Docs https://goo.gl/GijGKP')
} else if (!disableGlobalListenersWarnings && window.DeepLinkHandler !== undefined && window.DeepLinkHandler.toString() !== deepLinkDataParser.toString()) {
// deprecated 3.0.0: open and non deep link data will pass into DeepLinkHandler
console.warn('BRANCH SDK: Your DeepLinkHandler has changed. It will now pass non-Branch data. https://goo.gl/GijGKP')
console.warn('BRANCH SDK: Your DeepLinkHandler has changed. It will now pass non-Branch data. Docs https://goo.gl/GijGKP')
} else {
// from iOS and Android SDKs to JavaScript
window.DeepLinkHandler = deepLinkDataParser
Expand Down

0 comments on commit da61e06

Please sign in to comment.