Silence fetch errors caused by websocket action (#1797)

This commit is contained in:
Harrison Healey 2018-06-21 18:17:29 -04:00 committed by Elias Nahum
parent 92b992d204
commit e19b6a08d3
3 changed files with 9 additions and 5 deletions

View file

@ -18,11 +18,15 @@ Client4.doFetchWithResponse = async (url, options) => {
url,
};
}
const response = await fetch(url, Client4.getOptions(options));
const headers = response.headers;
let response;
let headers;
let data;
try {
response = await fetch(url, Client4.getOptions(options));
headers = response.headers;
data = await response.json();
} catch (err) {
if (response && response.resp && response.resp.data && response.resp.data.includes('SSL certificate')) {

4
package-lock.json generated
View file

@ -9878,8 +9878,8 @@
}
},
"mattermost-redux": {
"version": "github:mattermost/mattermost-redux#c9b633da7fc3fc9ba3cc40ecc9665e088defbe73",
"from": "github:mattermost/mattermost-redux#c9b633da7fc3fc9ba3cc40ecc9665e088defbe73",
"version": "github:mattermost/mattermost-redux#d2e9ba4f30a7bdfccda9aab1cfa8124c4ca1f275",
"from": "github:mattermost/mattermost-redux#d2e9ba4f30a7bdfccda9aab1cfa8124c4ca1f275",
"requires": {
"deep-equal": "1.0.1",
"eslint-plugin-header": "1.2.0",

View file

@ -15,7 +15,7 @@
"intl": "1.2.5",
"jail-monkey": "1.0.0",
"jsc-android": "216113.0.3",
"mattermost-redux": "github:mattermost/mattermost-redux#c9b633da7fc3fc9ba3cc40ecc9665e088defbe73",
"mattermost-redux": "github:mattermost/mattermost-redux#d2e9ba4f30a7bdfccda9aab1cfa8124c4ca1f275",
"mime-db": "1.33.0",
"prop-types": "15.6.1",
"react": "16.3.2",