'use strict'


class Response {
  constructor(messenger, msg) {
    this.messenger = messenger
    this.queue = msg.properties.replyTo
    this.corr = msg.properties.correlationId
  }

  send (msg) {
    if(this.queue){
      this.messenger.publish(this.queue, msg)
    }
  }

  ok (payload) {
    this.send({
      status: 'ok',
      correlationId: this.corr,
      content: payload
    })
  }

  error (payload) {
    this.send({
      status: 'ok',
      correlationId: this.corr,
      content: payload
    })
  }
}

module.exports = Response
@@ -433,34 +433,37 @@
 %0A      status: '
-ok
+error
 ',%0A      correla

return 'error' when error :/