From 9be75c20ca92bffea8e83c498b53a694d8a73197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Tue, 31 Aug 2021 18:25:06 +0200 Subject: [PATCH] typescript catch error any. --- client/src/components/about.vue | 2 +- client/src/components/video.vue | 4 ++-- client/src/neko/base.ts | 4 ++-- client/src/store/emoji.ts | 2 +- client/src/store/settings.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/components/about.vue b/client/src/components/about.vue index b7135024..a2af3136 100644 --- a/client/src/components/about.vue +++ b/client/src/components/about.vue @@ -154,7 +154,7 @@ context: 'github/gollum', }) this.$accessor.client.setAbout(res2.data) - } catch (err) { + } catch (err: any) { console.error(err) } finally { this.loading = false diff --git a/client/src/components/video.vue b/client/src/components/video.vue index 89936833..e583f016 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -490,7 +490,7 @@ try { await this._video.play() this.onResise() - } catch (err) { + } catch (err: any) { this.$log.error(err) } } @@ -577,7 +577,7 @@ this.$accessor.remote.setClipboard(text) this.$accessor.remote.sendClipboard(text) } - } catch (err) { + } catch (err: any) { this.$log.error(err) } } diff --git a/client/src/neko/base.ts b/client/src/neko/base.ts index 84270d04..8de61736 100644 --- a/client/src/neko/base.ts +++ b/client/src/neko/base.ts @@ -62,7 +62,7 @@ export abstract class BaseClient extends EventEmitter { this._ws.onerror = (event) => this.onError.bind(this) this._ws.onclose = (event) => this.onDisconnected.bind(this, new Error('websocket closed')) this._timeout = window.setTimeout(this.onTimeout.bind(this), 15000) - } catch (err) { + } catch (err: any) { this.onDisconnected(err) } } @@ -269,7 +269,7 @@ export abstract class BaseClient extends EventEmitter { displayname: this._displayname, }), ) - } catch (err) { + } catch (err: any) { this.emit('error', err) } } diff --git a/client/src/store/emoji.ts b/client/src/store/emoji.ts index b7a17cda..15c09736 100644 --- a/client/src/store/emoji.ts +++ b/client/src/store/emoji.ts @@ -66,7 +66,7 @@ export const actions = actionTree( } accessor.emoji.setList(req.data.list) accessor.emoji.setKeywords(req.data.keywords) - } catch (err) { + } catch (err: any) { console.error(err) } }, diff --git a/client/src/store/settings.ts b/client/src/store/settings.ts index 951b227f..3d99fad3 100644 --- a/client/src/store/settings.ts +++ b/client/src/store/settings.ts @@ -74,7 +74,7 @@ export const actions = actionTree( try { const req = await $http.get('keyboard_layouts.json') accessor.settings.setKeyboardLayoutsList(req.data) - } catch (err) { + } catch (err: any) { console.error(err) } },