maureentsakiris / coastwards

coastwards.org - a global citizen science project to help scientists study the risks of sea-level rise
http://coastwards.org
MIT License
5 stars 1 forks source link

Uncaught (in promise) Error #21

Closed maureentsakiris closed 7 years ago

maureentsakiris commented 7 years ago

https://vision.googleapis.com/v1/images:annotate?fields=responses&key=AIzaSyBL_zQUvMQNSnljycIZbHTYvscgYNLsp50 Failed to load resource: net::ERR_QUIC_PROTOCOL_ERROR

Uncaught (in promise) Error: Given action "SET_ERROR_MSG", reducer "error" returned undefined. To ignore an action, you must explicitly return the previous state. at http://coastwards.org/build/index.bundle.js:19:1187 at i (:1:18467) at u (:1:18753) at :1:21682 at Object.c [as dispatch] (http://coastwards.org/build/index.bundle.js:18:28513) at dispatch (:1:22124) at http://coastwards.org/build/index.bundle.js:19:12219 at dispatch (http://coastwards.org/build/index.bundle.js:19:2311) at http://coastwards.org/build/index.bundle.js:51:16742

maureentsakiris commented 7 years ago

Generic error message in case

let msg = error.message ? error.message : 'an_error_occurred'
dispatch( { type: types.SET_ERROR_MSG, to: msg } )

And catching response error from Google (and XHR)


if( response.error ){
    reject( Error( 'error_response_google' ) )
}