hof 21.0.8-axios-beta → 21.0.9-axios-beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/model/index.js +4 -18
  2. package/package.json +1 -1
package/model/index.js CHANGED
@@ -41,7 +41,6 @@ module.exports = class Model extends EventEmitter {
41
41
  }
42
42
 
43
43
  return this.prepare().then(data => {
44
- console.log("after prepare promise")
45
44
  data = JSON.stringify(data);
46
45
  const reqConf = this.requestConfig(options);
47
46
  reqConf.method = options.method || 'POST';
@@ -122,7 +121,6 @@ module.exports = class Model extends EventEmitter {
122
121
  return new Promise((resolve, reject) => {
123
122
  const _callback = (err, data, statusCode) => {
124
123
  if (timeoutTimer) {
125
- console.log("heerrererererer222")
126
124
  clearTimeout(timeoutTimer);
127
125
  timeoutTimer = null;
128
126
  }
@@ -130,18 +128,14 @@ module.exports = class Model extends EventEmitter {
130
128
  const endTime = process.hrtime();
131
129
  const responseTime = timeDiff(startTime, endTime);
132
130
  if (err) {
133
- console.log("heerrererererer444")
134
- console.log("d",data)
135
- console.log("e",err)
136
- console.log("os", originalSettings)
137
- console.log("sc", statusCode)
138
- console.log("rt", responseTime)
139
- console.log("heerrererererer444")
140
131
  this.emit('fail', err, data, originalSettings, statusCode, responseTime);
141
132
  } else {
142
- console.log("heerrererererer555")
133
+ console.log("SUCCESS>>>>>>>>>>>>>>>")
143
134
  this.emit('success', data, originalSettings, statusCode, responseTime);
144
135
  }
136
+ console.log("*****ERRR********")
137
+ console.log(err)
138
+ console.log("*****ERRR********")
145
139
  if (err) {
146
140
  console.log("err11")
147
141
  console.log(err)
@@ -151,19 +145,15 @@ module.exports = class Model extends EventEmitter {
151
145
  resolve(data);
152
146
  }
153
147
  };
154
- console.log("settings---------------: ", settings);
155
148
  this._request(settings)
156
149
  .then(response => {
157
- console.log("heeeeeeyyy123")
158
150
  return this.handleResponse(response, (error, data, status) => {
159
- console.log("heeeeeeyyyy912")
160
151
  if (error) {
161
152
  error.headers = response.headers;
162
153
  }
163
154
  _callback(error, data, status);
164
155
  });
165
156
  }).catch(err => {
166
- console.log("heerrererererer111")
167
157
  if (err.code === 'ETIMEDOUT' || err.code === 'ESOCKETTIMEDOUT') {
168
158
  err.message = 'Connection timed out';
169
159
  err.status = 504;
@@ -181,13 +171,10 @@ module.exports = class Model extends EventEmitter {
181
171
  }
182
172
 
183
173
  handleResponse(response, callback) {
184
- console.log("handleresponse.....><<>")
185
174
  let data = {};
186
175
  try {
187
- console.log("TRYhandleresponse.....><<>")
188
176
  data = typeof response.data === 'object' ? response.data : JSON.parse(response.data || '{}');
189
177
  } catch (err) {
190
- console.log("CATCHhandleresponse.....><<>")
191
178
  err.status = response.status;
192
179
  err.body = response.data;
193
180
  return callback(err, null, response.status);
@@ -209,7 +196,6 @@ module.exports = class Model extends EventEmitter {
209
196
  }
210
197
 
211
198
  prepare() {
212
- console.log("prepare() promise")
213
199
  return Promise.resolve(this.toJSON());
214
200
  }
215
201
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "21.0.8-axios-beta",
4
+ "version": "21.0.9-axios-beta",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",