fix(link/open tracking): Update error messages

This commit is contained in:
Ben Gotow 2016-02-25 13:32:51 -08:00
parent 5694b3e4fb
commit ddb2de7b65
2 changed files with 5 additions and 5 deletions

View file

@ -25,12 +25,12 @@ function afterDraftSend({message}) {
post({ post({
url: serverUrl, url: serverUrl,
body: JSON.stringify(data), body: JSON.stringify(data),
}).then( ([response, responseBody]) => { }).then(([response, responseBody]) => {
if (response.statusCode !== 200) { if (response.statusCode !== 200) {
throw new Error(`Link Tracking server error ${response.statusCode} at ${serverUrl}: ${responseBody}`); throw new Error(`Server error ${response.statusCode} at ${serverUrl}: ${responseBody}`);
} }
}).catch(error => { }).catch(error => {
NylasEnv.showErrorDialog("There was a problem contacting the Link Tracking server! This message will not have link tracking"); NylasEnv.showErrorDialog(`There was a problem saving your link tracking settings. This message will not have link tracking. ${error.message}`);
Promise.reject(error); Promise.reject(error);
}); });
} }

View file

@ -29,10 +29,10 @@ function afterDraftSend({message}) {
body: JSON.stringify(data), body: JSON.stringify(data),
}).then(([response, responseBody]) => { }).then(([response, responseBody]) => {
if (response.statusCode !== 200) { if (response.statusCode !== 200) {
throw new Error(responseBody); throw new Error(`Server error ${response.statusCode} at ${serverUrl}: ${responseBody}`);
} }
}).catch(error => { }).catch(error => {
NylasEnv.showErrorDialog(`There was a problem saving your open tracking settings. This message will not have open tracking. ${error.message}`); NylasEnv.showErrorDialog(`There was a problem saving your read receipt settings. This message will not have a read receipt. ${error.message}`);
Promise.reject(error); Promise.reject(error);
}); });
} }