File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
examples/type-n-search/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,20 @@ const MostTypeNSearch = connect(function(intent$){
28
28
. map ( url => rest ( url ) . then ( resp => ( {
29
29
type : 'dataUpdate' ,
30
30
value : resp . entity
31
- } ) ) )
31
+ } ) ) . catch ( error => {
32
+ console . error ( 'API REQUEST ERROR:' , error )
33
+ return {
34
+ type : 'dataError' ,
35
+ value : error . message
36
+ }
37
+ } ) )
32
38
. flatMap ( most . fromPromise )
33
39
. filter ( i => i . type == 'dataUpdate' )
34
40
. map ( data => JSON . parse ( data . value ) . items )
35
41
. map ( items => items . slice ( 0 , 10 ) )
36
42
. map ( items => state => ( { results : items } ) )
37
43
. flatMapError ( error => {
38
- console . log ( '[ERROR]:' , error ) ;
44
+ console . log ( '[CRITICAL ERROR]:' , error ) ;
39
45
return most . of ( { message :error . error , className :'display' } )
40
46
. merge ( most . of ( { className :'hidden' } ) . delay ( 3000 ) )
41
47
. map ( error => state => ( { error} ) )
You can’t perform that action at this time.
0 commit comments