Replace console.error with logger.error
Related https://github.com/vector-im/element-web/issues/18425
This commit is contained in:
parent
9c594a8a96
commit
5e73a212f4
124 changed files with 417 additions and 250 deletions
|
@ -103,7 +103,7 @@ class FlairStore extends EventEmitter {
|
|||
// Return silently to avoid spamming for non-supporting servers
|
||||
return;
|
||||
}
|
||||
console.error('Could not get groups for user', userId, err);
|
||||
logger.error('Could not get groups for user', userId, err);
|
||||
throw err;
|
||||
}).finally(() => {
|
||||
delete this._usersInFlight[userId];
|
||||
|
|
|
@ -20,6 +20,8 @@ import FlairStore from './FlairStore';
|
|||
import { MatrixClientPeg } from '../MatrixClientPeg';
|
||||
import dis from '../dispatcher/dispatcher';
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
export function parseMembersResponse(response) {
|
||||
return response.chunk.map((apiMember) => groupMemberFromApiObject(apiMember));
|
||||
}
|
||||
|
@ -144,7 +146,7 @@ class GroupStore extends EventEmitter {
|
|||
return;
|
||||
}
|
||||
|
||||
console.error(`Failed to get resource ${stateKey} for ${groupId}`, err);
|
||||
logger.error(`Failed to get resource ${stateKey} for ${groupId}`, err);
|
||||
this.emit('error', err, groupId, stateKey);
|
||||
}).finally(() => {
|
||||
// Indicate finished request, allow for future fetches
|
||||
|
|
|
@ -22,6 +22,8 @@ import ModalWidgetDialog from "../components/views/dialogs/ModalWidgetDialog";
|
|||
import { WidgetMessagingStore } from "./widgets/WidgetMessagingStore";
|
||||
import { IModalWidgetOpenRequestData, IModalWidgetReturnData, Widget } from "matrix-widget-api";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IState {
|
||||
modal?: IModal<any>;
|
||||
openedFromId?: string;
|
||||
|
@ -81,7 +83,7 @@ export class ModalWidgetStore extends AsyncStoreWithClient<IState> {
|
|||
|
||||
const sourceMessaging = WidgetMessagingStore.instance.getMessaging(sourceWidget);
|
||||
if (!sourceMessaging) {
|
||||
console.error("No source widget messaging for modal widget");
|
||||
logger.error("No source widget messaging for modal widget");
|
||||
return;
|
||||
}
|
||||
sourceMessaging.notifyModalWidgetClose(data);
|
||||
|
|
|
@ -235,7 +235,7 @@ class RoomViewStore extends Store<ActionPayload> {
|
|||
storeRoomAliasInCache(payload.room_alias, result.room_id);
|
||||
roomId = result.room_id;
|
||||
} catch (err) {
|
||||
console.error("RVS failed to get room id for alias: ", err);
|
||||
logger.error("RVS failed to get room id for alias: ", err);
|
||||
dis.dispatch({
|
||||
action: 'view_room_error',
|
||||
room_id: null,
|
||||
|
|
|
@ -248,7 +248,7 @@ export class SetupEncryptionStore extends EventEmitter {
|
|||
this.phase = Phase.Finished;
|
||||
}, true);
|
||||
} catch (e) {
|
||||
console.error("Error resetting cross-signing", e);
|
||||
logger.error("Error resetting cross-signing", e);
|
||||
this.phase = Phase.Intro;
|
||||
}
|
||||
this.emit("update");
|
||||
|
|
|
@ -41,6 +41,8 @@ import { reorderLexicographically } from "../utils/stringOrderField";
|
|||
import { TAG_ORDER } from "../components/views/rooms/RoomList";
|
||||
import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
type SpaceKey = string | symbol;
|
||||
|
||||
interface IState {}
|
||||
|
@ -261,7 +263,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
viaServers: Array.from(viaMap.get(roomInfo.room_id) || []),
|
||||
}));
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
}
|
||||
return [];
|
||||
};
|
||||
|
|
|
@ -401,7 +401,7 @@ export class StopGapWidget extends EventEmitter {
|
|||
}
|
||||
} catch (e) {
|
||||
// All errors are non-fatal
|
||||
console.error("Error preparing widget communications: ", e);
|
||||
logger.error("Error preparing widget communications: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -473,7 +473,7 @@ export class StopGapWidget extends EventEmitter {
|
|||
|
||||
const raw = ev.getEffectiveEvent();
|
||||
this.messaging.feedEvent(raw, this.eventListenerRoomId).catch(e => {
|
||||
console.error("Error sending event to widget: ", e);
|
||||
logger.error("Error sending event to widget: ", e);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,8 @@ import { tryTransformPermalinkToLocalHref } from "../../utils/permalinks/Permali
|
|||
import { IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { Room } from "matrix-js-sdk/src/models/room";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
// TODO: Purge this from the universe
|
||||
|
||||
function getRememberedCapabilitiesForWidget(widget: Widget): Capability[] {
|
||||
|
@ -122,7 +124,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||
(result.approved || []).forEach(cap => allowedSoFar.add(cap));
|
||||
rememberApproved = result.remember;
|
||||
} catch (e) {
|
||||
console.error("Non-fatal error getting capabilities: ", e);
|
||||
logger.error("Non-fatal error getting capabilities: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue