@@ -28,7 +28,7 @@ import { filter, takeUntil, first } from 'rxjs/operators';
28
28
import Daemon from './daemon' ;
29
29
30
30
// Required agent version
31
- const MIN_VERSION = '1.1.71 ' ;
31
+ const MIN_VERSION = '1.1.72 ' ;
32
32
const browser = detect ( ) ;
33
33
const POLLING_INTERVAL = 2500 ;
34
34
const UPLOAD_DONE_TIMER = 5000 ;
@@ -157,10 +157,7 @@ export default class SocketDaemon extends Daemon {
157
157
if ( updateAttempts < 4 ) {
158
158
return timer ( 10000 ) . subscribe ( ( ) => this . update ( ) ) ;
159
159
}
160
- const currentError = this . error . getValue ( ) ;
161
- if ( currentError !== 'plugin version incompatible' ) {
162
- this . error . next ( 'plugin version incompatible' ) ;
163
- }
160
+ this . error . next ( 'plugin version incompatible' ) ;
164
161
return Promise . reject ( new Error ( 'plugin version incompatible' ) ) ;
165
162
}
166
163
@@ -251,15 +248,19 @@ export default class SocketDaemon extends Daemon {
251
248
headers : {
252
249
'Content-Type' : 'text/plain; charset=utf-8'
253
250
}
254
- } ) . then ( ( ) => Promise . reject ( ) ) // We reject the promise because the daemon will be restarted, we need to continue looking for the port
255
- . catch ( err => {
256
- if ( err && err . data && err . data . error && ( err . data . error . indexOf ( 'proxy' ) !== - 1 || err . data . error . indexOf ( 'dial tcp' ) !== - 1 ) ) {
257
- const currentError = this . error . getValue ( ) ;
258
- if ( currentError !== 'proxy error' ) {
251
+ } )
252
+ . then ( result => result . json ( ) )
253
+ . then ( response => {
254
+ if ( ! response . ok ) {
255
+ if ( response && response . error && ( response . error . indexOf ( 'proxy' ) !== - 1 || response . error . indexOf ( 'dial tcp' ) !== - 1 ) ) {
259
256
this . error . next ( 'proxy error' ) ;
257
+ return new Error ( 'proxy error' ) ;
260
258
}
261
259
}
262
- } ) ;
260
+ // We reject the promise because the daemon will be restarted, we need to continue looking for the port
261
+ return Promise . reject ( ) ;
262
+ } )
263
+ . catch ( err => Promise . reject ( err ) ) ;
263
264
}
264
265
265
266
/**
0 commit comments