diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-12-19 16:05:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-19 16:05:33 +0900 |
| commit | f123be38b93339f405468c8ed1aaa39d340b7791 (patch) | |
| tree | 7f6a440c03de83424f175c3f8d76bf69345d7c90 /packages/frontend/src/scripts | |
| parent | fix(frontend): serverContextの型エラーを修正 (#15131) (diff) | |
| download | sharkey-f123be38b93339f405468c8ed1aaa39d340b7791.tar.gz sharkey-f123be38b93339f405468c8ed1aaa39d340b7791.tar.bz2 sharkey-f123be38b93339f405468c8ed1aaa39d340b7791.zip | |
enhance(frontend): 照会の際にエラーを表示するように (#15147)
* enhance: 照会の失敗理由を表示するように
* Update Changelog
* fix
* fix test
* lookupErrors-> remoteLookupErrors
Diffstat (limited to 'packages/frontend/src/scripts')
| -rw-r--r-- | packages/frontend/src/scripts/lookup.ts | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/packages/frontend/src/scripts/lookup.ts b/packages/frontend/src/scripts/lookup.ts index a261ec0669..ddcbfe1a8d 100644 --- a/packages/frontend/src/scripts/lookup.ts +++ b/packages/frontend/src/scripts/lookup.ts @@ -33,7 +33,43 @@ export async function lookup(router?: Router) { uri: query, }); - os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject); + os.promiseDialog(promise, null, (err) => { + let title = i18n.ts.somethingHappened; + let text = err.message + '\n' + err.id; + + switch (err.id) { + case '974b799e-1a29-4889-b706-18d4dd93e266': + title = i18n.ts._remoteLookupErrors._federationNotAllowed.title; + text = i18n.ts._remoteLookupErrors._federationNotAllowed.description; + break; + case '1a5eab56-e47b-48c2-8d5e-217b897d70db': + title = i18n.ts._remoteLookupErrors._uriInvalid.title; + text = i18n.ts._remoteLookupErrors._uriInvalid.description; + break; + case '81b539cf-4f57-4b29-bc98-032c33c0792e': + title = i18n.ts._remoteLookupErrors._requestFailed.title; + text = i18n.ts._remoteLookupErrors._requestFailed.description; + break; + case '70193c39-54f3-4813-82f0-70a680f7495b': + title = i18n.ts._remoteLookupErrors._responseInvalid.title; + text = i18n.ts._remoteLookupErrors._responseInvalid.description; + break; + case 'a2c9c61a-cb72-43ab-a964-3ca5fddb410a': + title = i18n.ts._remoteLookupErrors._responseInvalid.title; + text = i18n.ts._remoteLookupErrors._responseInvalidIdHostNotMatch.description; + break; + case 'dc94d745-1262-4e63-a17d-fecaa57efc82': + title = i18n.ts._remoteLookupErrors._noSuchObject.title; + text = i18n.ts._remoteLookupErrors._noSuchObject.description; + break; + } + + os.alert({ + type: 'error', + title, + text, + }); + }, i18n.ts.fetchingAsApObject); const res = await promise; |