Skip to content

Commit

Permalink
Remove handleFetchError from the actions.js
Browse files Browse the repository at this point in the history
  • Loading branch information
eason9487 committed Jun 22, 2023
1 parent b913ee7 commit f3f0276
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions js/src/data/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { apiFetch } from '@wordpress/data-controls';
import { dispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

/**
Expand All @@ -17,18 +16,6 @@ import {
import { handleApiError } from '.~/utils/handleError';
import { adaptAdsCampaign } from './adapters';

export function handleFetchError( error, message ) {
const { createNotice } = dispatch( 'core/notices' );

// Only show errors that are not authorization issues.
if ( error.statusCode !== 401 ) {
createNotice( 'error', message );
}

// eslint-disable-next-line no-console
console.log( error );
}

/**
* @typedef {import('.~/data/types.js').AssetEntityGroupUpdateBody} AssetEntityGroupUpdateBody
* @typedef {import('./selectors').Tour} Tour
Expand Down

0 comments on commit f3f0276

Please sign in to comment.