@@ -14,19 +14,17 @@ function get(url) {
1414 return new Promise ( function ( resolve , reject ) {
1515 http . get ( url , function ( incoming ) {
1616 resolve ( incoming ) ;
17- } ) . on ( ' error' , reject ) ;
17+ } ) . on ( " error" , reject ) ;
1818 } ) ;
1919}
2020
2121function getWithRetry ( url , retryCount , previousError ) {
2222 retryCount = retryCount || 0 ;
2323 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 ) ) ;
2625 }
2726 return get ( url )
2827 . catch ( function ( error ) {
29- console . error ( 'error getting ' + url + ', retrying' ) ;
3028 return new Promise ( function ( resolve ) { setTimeout ( resolve , 10000 ) ; } )
3129 . then ( function ( ) {
3230 return getWithRetry ( url , retryCount + 1 , error ) ;
@@ -38,9 +36,9 @@ describe("Port function",function(){
3836 let service ;
3937 before ( function ( ) {
4038 this . timeout ( 60000 ) ;
41- service = new Plugin ( serverlessMock , { stage : ' test' } ) ;
39+ service = new Plugin ( serverlessMock , { stage : " test" } ) ;
4240 return service . installHandler ( ) ;
43- } )
41+ } ) ;
4442
4543 it ( "Port should return number" , function ( ) {
4644 assert ( typeof service . port , "number" ) ;
@@ -53,7 +51,6 @@ describe("Port function",function(){
5351 return new Promise ( function ( resolve ) { setTimeout ( resolve , 2000 ) ; } ) ;
5452 } )
5553 . then ( function ( ) {
56- console . log ( 'started handler' ) ;
5754 return getWithRetry ( `http://localhost:${ service . port } /shell/` ) ;
5855 } )
5956 . then ( function ( response ) {
0 commit comments