Skip to content

Commit

Permalink
feat(stor): emit connection event on upload success/failure
Browse files Browse the repository at this point in the history
  • Loading branch information
trs committed Feb 10, 2018
1 parent 6020409 commit ec30a5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/commands/registration/stor.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {

return this.reply(150).then(() => this.connector.socket.resume())
.then(() => Promise.join(streamPromise, socketPromise))
.tap(() => this.emit('STOR', null, fileName))
.finally(() => stream.destroy && stream.destroy());
})
.then(() => this.reply(226, fileName))
Expand All @@ -51,6 +52,7 @@ module.exports = {
})
.catch(err => {
log.error(err);
this.emit('STOR', err);
return this.reply(550, err.message);
})
.finally(() => {
Expand Down

0 comments on commit ec30a5a

Please # to comment.