@@ -685,11 +685,40 @@ pub async fn execute_command(
685685 Ok ( _) => break ,
686686 Err ( e) => {
687687 attempts += 1 ;
688- error ! (
689- "Attempt {}: ❌ Failed to upload discovery info: {}" ,
690- attempts, e
691- ) ;
688+ let error_msg = e. to_string ( ) ;
689+
690+ // Check if this is a Cloudflare block
691+ if error_msg. contains ( "403 Forbidden" )
692+ && ( error_msg. contains ( "Cloudflare" )
693+ || error_msg. contains ( "Sorry, you have been blocked" )
694+ || error_msg. contains ( "Attention Required!" ) )
695+ {
696+ error ! (
697+ "Attempt {}: ❌ Discovery service blocked by Cloudflare protection. This may indicate:" ,
698+ attempts
699+ ) ;
700+ error ! ( " • Your IP address has been flagged by Cloudflare security" ) ;
701+ error ! ( " • Too many requests from your location" ) ;
702+ error ! ( " • Network configuration issues" ) ;
703+ error ! ( " • Discovery service may be under DDoS protection" ) ;
704+ error ! (
705+ "Please contact support or try from a different network/IP address"
706+ ) ;
707+ } else {
708+ error ! (
709+ "Attempt {}: ❌ Failed to upload discovery info: {}" ,
710+ attempts, e
711+ ) ;
712+ }
713+
692714 if attempts >= max_attempts {
715+ if error_msg. contains ( "403 Forbidden" )
716+ && ( error_msg. contains ( "Cloudflare" )
717+ || error_msg. contains ( "Sorry, you have been blocked" ) )
718+ {
719+ error ! ( "❌ Unable to reach discovery service due to Cloudflare blocking after {} attempts" , max_attempts) ;
720+ error ! ( "This is likely a network/IP issue rather than a worker configuration problem" ) ;
721+ }
693722 std:: process:: exit ( 1 ) ;
694723 }
695724 }
0 commit comments