code: function timeout(message) {
      $log.warn('Plugin client request timeout: ' + serialize(message));
  
      var promiseIndex = lodash.findIndex(promises, function(promise) {
        return promise.id == message.header.id;
      });
  
      if (promiseIndex >= 0) {
        var promise = lodash.pullAt(promises, promiseIndex);
  
        message.response = {
          statusCode: 408,
          statusText: 'REQUEST_TIMED_OUT',
          data: {
            message: 'Request timed out.'
          }
        }
        promise[0].onComplete(message);
      } else {
        $log.warn('Message request timed out but there is no promise to fulfill: ' + serialize(message));
      }
    }
docs: Timeout a message waiting for a response. Enables the client app to process a message delivery failure.