@@ -14,19 +14,17 @@ function get(url) {
14
14
return new Promise ( function ( resolve , reject ) {
15
15
http . get ( url , function ( incoming ) {
16
16
resolve ( incoming ) ;
17
- } ) . on ( ' error' , reject ) ;
17
+ } ) . on ( " error" , reject ) ;
18
18
} ) ;
19
19
}
20
20
21
21
function getWithRetry ( url , retryCount , previousError ) {
22
22
retryCount = retryCount || 0 ;
23
23
if ( retryCount >= 3 ) {
24
- console . error ( 'Exceeded retry count for get of ' + url , previousError ) ;
25
- return Promise . reject ( new Error ( 'Exceeded retry count for get of ' + url ) ) ;
24
+ return Promise . reject ( new Error ( "Exceeded retry count for get of " + url + ": " + previousError . message ) ) ;
26
25
}
27
26
return get ( url )
28
27
. catch ( function ( error ) {
29
- console . error ( 'error getting ' + url + ', retrying' ) ;
30
28
return new Promise ( function ( resolve ) { setTimeout ( resolve , 10000 ) ; } )
31
29
. then ( function ( ) {
32
30
return getWithRetry ( url , retryCount + 1 , error ) ;
@@ -38,9 +36,9 @@ describe("Port function",function(){
38
36
let service ;
39
37
before ( function ( ) {
40
38
this . timeout ( 60000 ) ;
41
- service = new Plugin ( serverlessMock , { stage : ' test' } ) ;
39
+ service = new Plugin ( serverlessMock , { stage : " test" } ) ;
42
40
return service . installHandler ( ) ;
43
- } )
41
+ } ) ;
44
42
45
43
it ( "Port should return number" , function ( ) {
46
44
assert ( typeof service . port , "number" ) ;
@@ -53,7 +51,6 @@ describe("Port function",function(){
53
51
return new Promise ( function ( resolve ) { setTimeout ( resolve , 2000 ) ; } ) ;
54
52
} )
55
53
. then ( function ( ) {
56
- console . log ( 'started handler' ) ;
57
54
return getWithRetry ( `http://localhost:${ service . port } /shell/` ) ;
58
55
} )
59
56
. then ( function ( response ) {
0 commit comments