Skip to content

Commit

Permalink
revert packages/media-utils/src/utils/upload-media.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsilverstein committed Feb 10, 2025
1 parent 9817117 commit e5857e8
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/media-utils/src/utils/upload-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,9 @@ export function uploadMedia( {
// Reset to empty on failure.
setAndUpdateFiles( index, null );

let message: string;
if (
typeof error === 'object' &&
error !== null &&
'message' in error
) {
message =
typeof error.message === 'string'
? error.message
: String( error.message );
let message;
if ( error instanceof Error ) {
message = error.message;
} else {
message = sprintf(
// translators: %s: file name
Expand Down

0 comments on commit e5857e8

Please sign in to comment.