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$){
2828 . map ( url => rest ( url ) . then ( resp => ( {
2929 type : 'dataUpdate' ,
3030 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+ } ) )
3238 . flatMap ( most . fromPromise )
3339 . filter ( i => i . type == 'dataUpdate' )
3440 . map ( data => JSON . parse ( data . value ) . items )
3541 . map ( items => items . slice ( 0 , 10 ) )
3642 . map ( items => state => ( { results : items } ) )
3743 . flatMapError ( error => {
38- console . log ( '[ERROR]:' , error ) ;
44+ console . log ( '[CRITICAL ERROR]:' , error ) ;
3945 return most . of ( { message :error . error , className :'display' } )
4046 . merge ( most . of ( { className :'hidden' } ) . delay ( 3000 ) )
4147 . map ( error => state => ( { error} ) )
You can’t perform that action at this time.
0 commit comments