diff options
author | bobzel <zzzman@gmail.com> | 2025-01-21 10:16:51 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-01-21 10:16:51 -0500 |
commit | caf384bb374c47118296aa397446e85d3121116b (patch) | |
tree | da270043f88d6cfa0d6b8f1838a55f6faba35bfa /src/ClientUtils.ts | |
parent | 22daafa9c505eb9bffb8604be0924a7450d20113 (diff) | |
parent | a6a6929501b7ce9b3ceed73c7e8141a8d8f0c7dc (diff) |
Merge branch 'master' into alyssa-agent
Diffstat (limited to 'src/ClientUtils.ts')
-rw-r--r-- | src/ClientUtils.ts | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/ClientUtils.ts b/src/ClientUtils.ts index 8f62b9060..e5dbb81db 100644 --- a/src/ClientUtils.ts +++ b/src/ClientUtils.ts @@ -144,15 +144,20 @@ export namespace ClientUtils { export async function convertDataUri(imageUri: string, returnedFilename: string, nosuffix = false, replaceRootFilename: string | undefined = undefined) { try { const posting = ClientUtils.prepend('/uploadURI'); - const returnedUri = await rp.post(posting, { - body: { - uri: imageUri, - name: returnedFilename, - nosuffix, - replaceRootFilename, - }, - json: true, - }); + const returnedUri = await rp + .post(posting, { + body: { + uri: imageUri, + name: returnedFilename, + nosuffix, + replaceRootFilename, + }, + json: true, + }) + .catch(e => { + alert('Data URI Error: ' + e.toString()); + return undefined; + }); return returnedUri; } catch (e) { console.log('ConvertDataURI :' + e); |