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() {
7878 // handle errors like this:
7979 runTask ( {
8080 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+ } ) ;
9190 } ) ;
9291 }
9392
Original file line number Diff line number Diff line change @@ -61,16 +61,15 @@ export const BetterWaysCode = {
6161 // handle errors like this:
6262 runTask({
6363 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+ });
7473 });
7574 }
7675
You can’t perform that action at this time.
0 commit comments