diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-10-18 10:21:02 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-10-18 10:21:02 +0900 |
| commit | a15299ae53e0c791d975b30e7091dd6fa0dd1153 (patch) | |
| tree | 6850d9b0a0b23433dec7bb3ea1150a7b88013c44 /src/client | |
| parent | Improve waiting dialog (diff) | |
| download | misskey-a15299ae53e0c791d975b30e7091dd6fa0dd1153.tar.gz misskey-a15299ae53e0c791d975b30e7091dd6fa0dd1153.tar.bz2 misskey-a15299ae53e0c791d975b30e7091dd6fa0dd1153.zip | |
Improve api error dialog
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/os.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/os.ts b/src/client/os.ts index 688bc136df..49f4d11ad2 100644 --- a/src/client/os.ts +++ b/src/client/os.ts @@ -70,7 +70,12 @@ export function apiWithDialog( onFailure?: (e: Error) => void, ) { const promise = api(endpoint, data, token); - promiseDialog(promise, onSuccess, onFailure); + promiseDialog(promise, onSuccess, onFailure ? onFailure : (e) => { + dialog({ + type: 'error', + text: e.message + '\n' + (e as any).id, + }); + }); return promise; } |