File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1019,8 +1019,10 @@ function ($domain) {
10191019 $ domain = array_pop ($ domains );
10201020 $ attempt = 0 ;
10211021 $ success = false ;
1022+ $ lastError = null ;
10221023
10231024 while ($ attempt < $ maxRetries && !$ success ) {
1025+ $ lastError = null ;
10241026 $ attempt ++;
10251027 try {
10261028 $ response = $ this ->request ()->request (
@@ -1036,10 +1038,7 @@ function ($domain) {
10361038 ];
10371039 }
10381040 } catch (\Exception $ e ) {
1039- $ this ->logger ->debug (
1040- "Failed to wake the site: \n{message} " ,
1041- ['message ' => $ e ->getMessage (),]
1042- );
1041+ $ lastError = $ e ;
10431042 $ success = false ;
10441043 }
10451044
@@ -1048,6 +1047,12 @@ function ($domain) {
10481047 }
10491048 }
10501049
1050+ if ($ lastError ) {
1051+ throw new TerminusException (
1052+ 'Failed to wake the site after ' . $ maxRetries . ' attempts. Last error: ' . $ lastError ->getMessage ()
1053+ );
1054+ }
1055+
10511056 throw new TerminusException ('Failed to wake the site after ' . $ maxRetries . ' attempts. ' );
10521057 }
10531058
You can’t perform that action at this time.
0 commit comments