File tree Expand file tree Collapse file tree 2 files changed +18
-20
lines changed Expand file tree Collapse file tree 2 files changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,15 @@ export function ErrorHandling() {
78
78
// handle errors like this:
79
79
runTask ( {
80
80
loadingId : 'error-handled' ,
81
- task : ( ) =>
82
- mockAsyncError ( ) . catch ( e => {
83
- // handle the error however you want
84
- notifications . show ( {
85
- color : 'red' ,
86
- message : e . message ,
87
- icon : < IoMdAlert /> ,
88
- position : 'top-center' ,
89
- } ) ;
90
- } ) ,
81
+ task : ( ) => mockAsyncError ( ) ,
82
+ } ) . catch ( e => {
83
+ // handle the error here...
84
+ notifications . show ( {
85
+ color : 'red' ,
86
+ message : e . message ,
87
+ icon : < IoMdAlert /> ,
88
+ position : 'top-center' ,
89
+ } ) ;
91
90
} ) ;
92
91
}
93
92
Original file line number Diff line number Diff line change @@ -61,16 +61,15 @@ export const BetterWaysCode = {
61
61
// handle errors like this:
62
62
runTask({
63
63
loadingId: 'error-handled',
64
- task: () =>
65
- mockAsyncError().catch(e => {
66
- // handle the error however you want
67
- notifications.show({
68
- color: 'red',
69
- message: e.message,
70
- icon: <IoMdAlert />,
71
- position: 'top-center',
72
- });
73
- }),
64
+ task: () => mockAsyncError(),
65
+ }).catch(e => {
66
+ // handle the error here...
67
+ notifications.show({
68
+ color: 'red',
69
+ message: e.message,
70
+ icon: <IoMdAlert />,
71
+ position: 'top-center',
72
+ });
74
73
});
75
74
}
76
75
You can’t perform that action at this time.
0 commit comments