1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

Show errors in case of Duplicate adbkey

This commit is contained in:
Vishal Banthia 2016-11-23 03:11:09 +05:30
parent 20d8c35603
commit 42b55889ae
4 changed files with 27 additions and 3 deletions

View file

@ -397,8 +397,15 @@ module.exports = function(options) {
, wireutil.envelope(new wire.AdbKeysUpdatedMessage())
])
})
.catch(dbapi.DuplicateSecondaryIndexError, function() {
// No-op
.catch(dbapi.DuplicateSecondaryIndexError, function(err) {
socket.emit('user.keys.adb.error', {
message: 'Someone already added this key'
})
})
.catch(Error, function(err) {
socket.emit('user.keys.adb.error', {
message: err.message
})
})
})
.on('user.keys.adb.accept', function(data) {