Changes: use Fail message as toast title, only show actual message with fallback.

This commit is contained in:
Theros
2024-07-11 00:12:39 +01:00
parent fee36419ac
commit 51f09c1382

View File

@ -333,8 +333,9 @@ async function getCaptionForFile(file, prompt, quiet) {
return caption; return caption;
} }
catch (error) { catch (error) {
toastr.error(`Failed to caption image. ${error}`); const errorMessage = error.message || 'Unknown error';
console.log(error); toastr.error(errorMessage, "Failed to caption image.");
console.error(error);
return ''; return '';
} }
finally { finally {