wbaridon / matcha

0 stars 0 forks source link

Soucis de zipcode #130

Closed wbaridon closed 6 years ago

wbaridon commented 6 years ago

J'ai change le provider cote FakeProfiles pour que cela mette moins de temps. Je fait un call a l'api tous les 100ms.. En revanche que j'en fasse 1 ou 500 j'ai parfois une erreur sur le zipcode qui est problematique => Il se peut qu'il ne soit pas trouve. Une gestion d'erreur mettant une data par default pour la localisation si jamais le zipcode est pas trouve?

Unhandled rejection TypeError: Cannot read property 'zipcode' of undefined
    at Geocoder.geocoder.reverse.then.call (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/src/utils/fakeProfiles.js:88:78)
    at Geocoder.tryCatcher (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/promise.js:694:18)
    at _drainQueueStep (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
wbaridon commented 6 years ago

En revanche autre soucis incomprehensible a priori le gender c'est mal inscrit on a un tru au lieu de true...

sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Parser.js:80
        throw err; // Rethrow non-MySQL errors
        ^

Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Étang-la-Ville', 48.8738427, 2.0699577, 390, 1),('73', 'Dupont', 'Auguste', tru' at line 1
    at Query.Sequence._packetToError (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
    at Query.ErrorPacket (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Protocol.js:278:23)
    at Parser.write (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/Connection.js:91:28)
    at Socket.<anonymous> (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/Connection.js:502:10)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onread (net.js:638:20)
    --------------------
    at Protocol._enqueue (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Protocol.js:144:48)
    at Connection.query (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/Connection.js:200:25)
    at Promise (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/src/utils/fakeProfiles.js:212:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 fakeProfiles: `mysql.server start 2>&- 1>&-; sleep 1 && node src/utils/setup.js && node src/utils/fakeProfiles.js "500"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 fakeProfiles script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wbaridon/.npm/_logs/2018-10-08T07_47_27_031Z-debug.log
wbaridon commented 6 years ago
/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Parser.js:80
        throw err; // Rethrow non-MySQL errors
        ^

Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Étang-la-Ville', 48.8673627, 2.0593977, 72, 1),('1118', 'Michel', 'Robin', true' at line 1
    at Query.Sequence._packetToError (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
    at Query.ErrorPacket (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Protocol.js:278:23)
    at Parser.write (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/Connection.js:91:28)
    at Socket.<anonymous> (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/Connection.js:502:10)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onread (net.js:638:20)
    --------------------
    at Protocol._enqueue (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/protocol/Protocol.js:144:48)
    at Connection.query (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/node_modules/mysql/lib/Connection.js:200:25)
    at Promise (/sgoinfre/goinfre/Perso/wbaridon/matcha/server/src/utils/fakeProfiles.js:209:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 fakeProfiles: `mysql.server start 2>&- 1>&-; sleep 1 && node src/utils/setup.js && node src/utils/fakeProfiles.js "500"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 fakeProfiles script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wbaridon/.npm/_logs/2018-10-08T07_59_51_771Z-debug.log
wbaridon commented 6 years ago

Solve