From 77754cc3d8f8f83e161b580e0d1dabe16d104167 Mon Sep 17 00:00:00 2001
From: Mar0xy <marie@kaifa.ch>
Date: Tue, 26 Sep 2023 00:48:34 +0200
Subject: [PATCH] test: attempt catching error

---
 packages/megalodon/src/misskey.ts | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts
index babdf9794d..fe9f553ad4 100644
--- a/packages/megalodon/src/misskey.ts
+++ b/packages/megalodon/src/misskey.ts
@@ -610,7 +610,7 @@ export default class Misskey implements MegalodonInterface {
       max_id?: string
       since_id?: string
     }
-  ): Promise<Response<Array<Entity.Account>>> {
+  ): Promise<Response<Array<Entity.Account>> | any> {
     let params = {
       query: q,
       detail: true
@@ -631,7 +631,13 @@ export default class Misskey implements MegalodonInterface {
       return Object.assign(res, {
         data: res.data.map(u => MisskeyAPI.Converter.userDetail(u, this.baseUrl))
       })
-    })
+    }).catch(() => ({
+      data: {
+          accounts: [],
+          statuses: [],
+          hashtags: [],
+      }
+    }))
   }
 
   // ======================================