Skip to content

Commit

Permalink
External Media: Handle space errors on upload (#17014)
Browse files Browse the repository at this point in the history
  • Loading branch information
obenland authored Sep 3, 2020
1 parent f0c54b8 commit c714c84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions extensions/shared/external-media/sources/with-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ export default function withMedia() {
return;
}

// Normalize upload errors.
if ( error.errors?.length ) {
error = {
code: error.errors[ 0 ].error,
message: error.errors[ 0 ].message,
};
}

const { noticeOperations } = this.props;

noticeOperations.createErrorNotice(
Expand Down

0 comments on commit c714c84

Please sign in to comment.