Skip to content

Commit f5564fd

Browse files
Add localized error message to upload
1 parent 624c63a commit f5564fd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/locales/en/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,6 +2121,7 @@
21212121
"errorUnsafeVirusScan": "CivitAI detected malware or suspicious content in this file",
21222122
"errorModelTypeNotSupported": "This model type is not supported",
21232123
"errorUnknown": "An unexpected error occurred",
2124+
"errorUploadFailed": "Failed to upload asset. Please try again.",
21242125
"ariaLabel": {
21252126
"assetCard": "{name} - {type} asset",
21262127
"loadingAsset": "Loading asset"

src/platform/assets/services/assetService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,11 @@ function createAssetService() {
341341
})
342342

343343
if (!res.ok) {
344-
const errorText = await res.text().catch(() => 'Unknown error')
345344
throw new Error(
346-
`Failed to upload asset: Server returned ${res.status}. ${errorText}`
345+
st(
346+
'assetBrowser.errorUploadFailed',
347+
'Failed to upload asset. Please try again.'
348+
)
347349
)
348350
}
349351

0 commit comments

Comments
 (0)