fix(image_node): correct else block indentation in batch Discord send
The else block for error handling was incorrectly associated with the `if save_cdn_urls:` condition instead of the `if response.status_code in [200, 204]:` check. This caused discord_send_success to always be set to False after a successful batch send, regardless of the actual outcome. Fixes control flow bug identified in PR #35 review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
87c97e04a3
commit
1e94a69e5f
+3
-3
@@ -750,7 +750,7 @@ class DiscordSendSaveImage:
|
||||
print(f"Successfully sent batch of {len(batch_discord_files)} images to Discord as a gallery")
|
||||
discord_send_success = True
|
||||
discord_sent_files = ["batch_gallery"] # Mark as successfully sent
|
||||
|
||||
|
||||
# Extract CDN URLs and send file using shared utility
|
||||
if save_cdn_urls:
|
||||
new_urls = extract_cdn_urls_from_response(response)
|
||||
@@ -762,8 +762,8 @@ class DiscordSendSaveImage:
|
||||
send_func=send_to_discord_with_retry,
|
||||
message="Discord CDN URLs for the uploaded images:"
|
||||
)
|
||||
else:
|
||||
print(f"Error sending batch to Discord: Status code {response.status_code} - {response.text}")
|
||||
else:
|
||||
print(f"Error sending batch to Discord: Status code {response.status_code} - {response.text}")
|
||||
discord_send_success = False
|
||||
except Exception as e:
|
||||
print(f"Error sending batch to Discord: {e}")
|
||||
|
||||
Reference in New Issue
Block a user