Skip to content

Commit

Permalink
MediaManager: improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed Aug 19, 2022
1 parent aa1f62a commit 3ba695b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Expand Up @@ -278,6 +278,18 @@ class Api {
const response = JSON.parse(error.response);
if (response.message) {
notifications.error(response.message);
// Check for App messages queue
if (response.messages) {
Object.keys(response.messages).forEach((type) => {
response.messages[type].forEach((message) => {
if (type === 'error') {
notifications.error(message);
} else {
notifications.notify(message);
}
})
})
}
} else {
switch (error.status) {
case 409:
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/lib_joomla.ini
Expand Up @@ -681,7 +681,7 @@ JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file."
JLIB_MEDIA_ERROR_WARNFILENAME="File name must only have alphanumeric characters and no spaces."
JLIB_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload."
JLIB_MEDIA_ERROR_WARNFILETYPE="This file type is not supported."
JLIB_MEDIA_ERROR_WARNIEXSS="Possible IE XSS Attack found."
JLIB_MEDIA_ERROR_WARNIEXSS="The file looks suspicious, therefore cannot be uploaded."
JLIB_MEDIA_ERROR_WARNINVALID_IMG="Not a valid image."
JLIB_MEDIA_ERROR_WARNINVALID_MIME="Invalid mime type detected."
JLIB_MEDIA_ERROR_WARNINVALID_MIMETYPE="Illegal mime type detected: %s"
Expand Down
2 changes: 1 addition & 1 deletion language/en-GB/lib_joomla.ini
Expand Up @@ -678,7 +678,7 @@ JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file."
JLIB_MEDIA_ERROR_WARNFILENAME="File name must only have alphanumeric characters and no spaces."
JLIB_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload."
JLIB_MEDIA_ERROR_WARNFILETYPE="This file type is not supported."
JLIB_MEDIA_ERROR_WARNIEXSS="Possible IE XSS Attack found."
JLIB_MEDIA_ERROR_WARNIEXSS="The file looks suspicious, therefore cannot be uploaded."
JLIB_MEDIA_ERROR_WARNINVALID_IMG="Not a valid image."
JLIB_MEDIA_ERROR_WARNINVALID_MIME="Invalid mime type detected."
JLIB_MEDIA_ERROR_WARNINVALID_MIMETYPE="Illegal mime type detected: %s"
Expand Down

0 comments on commit 3ba695b

Please sign in to comment.