fix error handling 2
This commit is contained in:
parent
ceaeadb84b
commit
188821b0f1
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in New Issue