forked from Ivasoft/mattermost-mobile
Remove logError remote action (#6193)
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
//fixme: to be completed in next PR.
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export const logError = (_e: any) => null;
|
||||
|
||||
// export const logError = async (error: Error, displayable = false) => {
|
||||
// if (error?.server_error_id === 'api.context.session_expired.app_error') {
|
||||
// return {data: true};
|
||||
// }
|
||||
//
|
||||
// const serializedError = serializeError(error);
|
||||
//
|
||||
// let sendToServer = true;
|
||||
// if (error.stack && error.stack.includes('TypeError: Failed to fetch')) {
|
||||
// sendToServer = false;
|
||||
// }
|
||||
// if (error?.server_error_id) {
|
||||
// sendToServer = false;
|
||||
// }
|
||||
//
|
||||
// if (sendToServer) {
|
||||
// try {
|
||||
// const stringifiedSerializedError = JSON.stringify(serializedError).toString();
|
||||
// await Client4.logClientError(stringifiedSerializedError);
|
||||
// } catch (err) {
|
||||
// // avoid crashing the app if an error sending
|
||||
// // the error occurs.
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// EventEmitter.emit(ErrorTypes.LOG_ERROR, error);
|
||||
// dispatch(getLogErrorAction(serializedError, displayable));
|
||||
|
||||
// return {data: true};
|
||||
// };
|
||||
|
||||
@@ -15,7 +15,6 @@ import {getCurrentUserId, getCommonSystemValues} from '@queries/servers/system';
|
||||
import {getCSRFFromCookie} from '@utils/security';
|
||||
|
||||
import {loginEntry} from './entry';
|
||||
import {logError} from './error';
|
||||
import {fetchDataRetentionPolicy} from './systems';
|
||||
import {autoUpdateTimezone} from './user';
|
||||
|
||||
@@ -89,7 +88,6 @@ export const getSessions = async (serverUrl: string, currentUserId: string) => {
|
||||
try {
|
||||
return await client.getSessions(currentUserId);
|
||||
} catch (e) {
|
||||
logError(e);
|
||||
await forceLogoutIfNecessary(serverUrl, e as ClientError);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
import deepEqual from 'deep-equal';
|
||||
|
||||
import {logError} from '@actions/remote/error';
|
||||
import {forceLogoutIfNecessary} from '@actions/remote/session';
|
||||
import {SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import DatabaseManager from '@database/manager';
|
||||
@@ -32,8 +31,6 @@ export const fetchDataRetentionPolicy = async (serverUrl: string) => {
|
||||
data = await client.getDataRetentionPolicy();
|
||||
} catch (error) {
|
||||
forceLogoutIfNecessary(serverUrl, error as ClientError);
|
||||
|
||||
logError(error);
|
||||
return {error};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user