mirror of
https://github.com/franjsco/trackmyd-bot
synced 2025-06-05 22:19:29 +02:00
fix error handling 2
This commit is contained in:
@@ -111,9 +111,6 @@ bot.on('/remove', (msg) => {
|
|||||||
bot.on('ask.removeDevice', (msg) => {
|
bot.on('ask.removeDevice', (msg) => {
|
||||||
api.removeDevice(msg.text)
|
api.removeDevice(msg.text)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res instanceof Error) {
|
|
||||||
throw res;
|
|
||||||
}
|
|
||||||
bot.sendMessage(msg.from.id, 'Device Removed');
|
bot.sendMessage(msg.from.id, 'Device Removed');
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
Reference in New Issue
Block a user