PROGRADE-Tech / Tarchivebot

:page_with_curl: Telegram chat message archive and statistics
https://tarchive.neat.moe
GNU Affero General Public License v3.0
10 stars 4 forks source link

Provide error and data parameters in every API callback #69

Open fuerbringer opened 7 years ago

fuerbringer commented 7 years ago

Most callbacks in the API except the word count call are missing the proper callback format callback(error, data). Should be useful to pass error messages to the front end (like this res.send(JSON.stringify({'error': error}))).

Also Standard.js seems to like it that way.

Relevant files are api.js and apibackend.js.