Skip to content

Commit

Permalink
fix(deps): update dependency typescript to v4.5.2 (#1984)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency typescript to v4.5.2

* refactor: fixed TS compatibility of error catching

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Sebastian Rettig <serettig@posteo.de>
  • Loading branch information
3 people committed Nov 21, 2021
1 parent 38e6f31 commit ecc3640
Show file tree
Hide file tree
Showing 39 changed files with 105 additions and 125 deletions.
14 changes: 7 additions & 7 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"shortid": "2.2.16",
"socket.io-client": "4.4.0",
"superagent": "6.1.0",
"typescript": "4.3.5",
"typescript": "4.5.2",
"web-vitals": "2.1.2"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions client/src/helpers/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export default class Logger {
try {
this.logLevel =
(window.localStorage.logLevel as logLevel) || 'info';
} catch (error) {
this.ERROR(error);
} catch (error: any) {
this.ERROR(error as string);
this.logLevel = 'info';
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/state/Analytics/AnalyticsActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function importAnalytics(): any {
payload: { files },
type: ANALYTICS_IMPORT_SUCCESS
});
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

console.log(error);
Expand Down
4 changes: 2 additions & 2 deletions client/src/state/Analytics/AnalyticsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export default function analyticsReducer(
default:
return state;
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

log.error(error);
log.error(error as string);
return state;
}
}
19 changes: 10 additions & 9 deletions client/src/state/H5PEditor/H5PEditorActions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ThunkAction, ThunkDispatch } from 'redux-thunk';
import * as Sentry from '@sentry/browser';

import Logger from '../../helpers/Logger';

import * as H from 'history';
Expand Down Expand Up @@ -151,7 +152,7 @@ export function exportH5P(
options
);

// TOOD: chang tracking
// TODO: change tracking
dispatch(
track(
'H5P',
Expand All @@ -171,7 +172,7 @@ export function exportH5P(
},
type: H5PEDITOR_EXPORT_SUCCESS
});
} catch (error) {
} catch (error: any) {
if (error.status === 499) {
// dispatched if the user cancel the system's save dialog.
dispatch(cancelExportH5P(data.contentId));
Expand All @@ -187,7 +188,7 @@ export function exportH5P(
});
}
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

dispatch({
Expand Down Expand Up @@ -283,7 +284,7 @@ export function updateContentOnServer(): any {
try {
const data = await window.h5peditor.current?.save();
return data;
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
return;
}
Expand Down Expand Up @@ -338,7 +339,7 @@ export function updateContent(
});

return response;
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
dispatch({
payload: {
Expand Down Expand Up @@ -373,7 +374,7 @@ export function loadEditorContent(
});

return content;
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

throw new Error(error);
Expand Down Expand Up @@ -457,7 +458,7 @@ export function save(

try {
dispatch(track('H5P', 'save', data.metadata?.mainLibrary));
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
}

Expand All @@ -466,7 +467,7 @@ export function save(
payload: { id: data.contentId, ...response.body },
type: H5PEDITOR_SAVE_SUCCESS
});
} catch (error) {
} catch (error: any) {
if (error.status === 499) {
return dispatch({
payload: {},
Expand Down Expand Up @@ -506,7 +507,7 @@ export function importH5P(
.then(({ body }) => {
try {
dispatch(track('H5P', 'open', body.metadata.mainLibrary));
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/state/H5PEditor/H5PEditorReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export default function tabReducer(
default:
return state;
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

log.error(error);
Expand Down
10 changes: 5 additions & 5 deletions client/src/state/H5PEditor/H5PEditorSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function all(state: IState): ITab[] {
try {
log.debug(`selecting tab-list`);
return state.h5peditor.tabList || [];
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

log.error(error);
Expand All @@ -33,7 +33,7 @@ export function activeTabIndex(state: IState): number {
try {
log.debug(`selecting activeTabIndex`);
return state.h5peditor.activeTabIndex || 0;
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

log.error(error);
Expand All @@ -48,7 +48,7 @@ export function activeTab(state: IState): ITab {
state.h5peditor.tabList[state.h5peditor.activeTabIndex] ||
errorObject
);
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

log.error(error);
Expand All @@ -59,7 +59,7 @@ export function activeTab(state: IState): ITab {
export function noActiveTabs(state: IState): boolean {
try {
return state.h5peditor.tabList.length === 0;
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

log.error(error);
Expand All @@ -77,7 +77,7 @@ export function viewDisabled(state: IState): boolean {
try {
return state.h5peditor.tabList[state.h5peditor.activeTabIndex]
.viewDisabled;
} catch (error) {
} catch (error: any) {
return true;
}
}
2 changes: 1 addition & 1 deletion client/src/state/Notifications/NotificationsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export default function notificationsReducer(
default:
return state;
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
return state;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/state/Notifications/NotificationsSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function notifications(state: any): INotification[] {
try {
log.debug(`selecting notifications`);
return state.notifications.notifications || [];
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

log.error(error);
Expand Down
12 changes: 6 additions & 6 deletions client/src/state/Run/RunActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function getRuns(): any {
payload: runResponse,
type: RUN_GET_RUNS_SUCCESS
});
} catch (error) {
} catch (error: any) {
if (error.status === 401) {
return dispatch({
payload: {},
Expand All @@ -53,7 +53,7 @@ export function getRuns(): any {
type: RUN_GET_RUNS_ERROR
});
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
}
};
Expand Down Expand Up @@ -94,7 +94,7 @@ export function upload(options?: { path?: string; contentId?: string }) {
)
);
dispatch(getRuns());
} catch (error) {
} catch (error: any) {
if (error.status !== 499) {
Sentry.captureException(error);

Expand All @@ -114,7 +114,7 @@ export function upload(options?: { path?: string; contentId?: string }) {
// user canceled electrons openfile dialog
dispatch(updateState({ showUploadDialog: false }));
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
}
};
Expand Down Expand Up @@ -142,15 +142,15 @@ export function deleteFromRun(id: string): any {
'success'
)
);
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

dispatch({
payload: { error },
type: RUN_DELETE_ERROR
});
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
}
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/state/Run/RunReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function runReducer(
default:
return state;
}
} catch (error) {
} catch (error: any) {
log.error(error);
return state;
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/state/Settings/SettingsActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export function getSettings(): any {
type: SETTINGS_GET_SETTINGS_SUCCESS
});
return settings;
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

dispatch({
payload: { error },
type: SETTINGS_GET_SETTINGS_ERROR
});
}
} catch (error) {}
} catch (error: any) {}
};
}

Expand All @@ -60,7 +60,7 @@ export function updateSettings(settings: ISettingsState): any {
if (settings.privacyPolicyConsent) {
await API.updateContentTypeCache();
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

dispatch({
Expand Down Expand Up @@ -93,7 +93,7 @@ export function changeSetting(
if (save) {
dispatch(updateSettings(store.getState().settings));
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
}
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/state/Settings/SettingsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function settingsReducer(
default:
return state;
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
return state;
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/state/System/SystemActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export function getSystem(): any {
type: SYSTEM_GET_SYSTEM_SUCCESS
});
return system;
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);

dispatch({
payload: { error },
type: SYSTEM_GET_SYSTEM_ERROR
});
}
} catch (error) {}
} catch (error: any) {}
};
}
2 changes: 1 addition & 1 deletion client/src/state/System/SystemReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function settingsReducer(
default:
return state;
}
} catch (error) {
} catch (error: any) {
Sentry.captureException(error);
return state;
}
Expand Down

0 comments on commit ecc3640

Please sign in to comment.