Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. yield tmap(reports, function *(report) {
  2. debug('Sending PUT request to metering hub');
  3. const res = yield brequest.put({
  4. uri: url + '/orgs',
  5. headers: { 'Content-Type': 'application/json' },
  6. body: report
  7. });
  8. debug('Received response %s from metering hub', res.statusCode);
  9.  
  10. if (res.statusCode !== 204) {
  11. edebug('Unable to put usage reports to metering hub, %s: %o',
  12. res.statusCode, res.body);
  13.  
  14. // Throw response object as an exception to stop further processing
  15. throw res;
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement