File tree 2 files changed +4
-2
lines changed
templates/api-v5/internal
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ export const loggerMiddleware = () => (next) => (action) => {
10
10
if ( process . env . NODE_ENV === 'development' ) {
11
11
console . warn ( 'redux action error' , action ) ;
12
12
}
13
- logger . error (
13
+ const isFetchError = metaAction . payload ?. status === 'FETCH_ERROR' ;
14
+ logger [ isFetchError ? 'warning' : 'error' ] (
14
15
{
15
16
message : 'redux action error' ,
16
17
customText : metaAction . type ,
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ export const loggerMiddleware: Middleware = () => (next) => (action) => {
25
25
// eslint-disable-next-line no-console
26
26
console . warn ( 'redux action error' , action ) ;
27
27
}
28
- logger . error (
28
+ const isFetchError = ( metaAction . payload as undefined | { status ?: string | number } ) ?. status === 'FETCH_ERROR' ;
29
+ logger [ isFetchError ? 'warning' : 'error' ] (
29
30
{
30
31
message : 'redux action error' ,
31
32
customText : metaAction . type ,
You can’t perform that action at this time.
0 commit comments