Skip to content

Conversation

@Goooler
Copy link
Member

@Goooler Goooler commented Nov 30, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to simplify the exception handling logic for Zip64RequiredException by removing redundant checks. However, the simplification introduces a bug by only checking if the exception's cause is a Zip64RequiredException, while removing the check for whether the exception itself is a Zip64RequiredException.

Key Changes

  • Simplified the conditional check from e is Zip64RequiredException || e.cause is Zip64RequiredException to only cause is Zip64RequiredException
  • Changed message extraction from conditional logic to directly using cause.message

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +70 to +74
val cause = e.cause
if (cause is Zip64RequiredException) {
throw Zip64RequiredException(
"""
$message
${cause.message}
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplified check misses the case where e itself is a Zip64RequiredException (not wrapped in another exception). The original code checked both e is Zip64RequiredException and e.cause is Zip64RequiredException, but the new code only checks the cause. This means if a Zip64RequiredException is thrown directly, it won't be caught here and users won't see the helpful error message about enabling zip64.

Consider restoring the check to handle both cases:

val cause = e.cause
if (e is Zip64RequiredException || cause is Zip64RequiredException) {
  val message = if (e is Zip64RequiredException) e.message else cause?.message
  throw Zip64RequiredException(
    """
      $message
      
      To build this archive, please enable the zip64 extension. e.g.
      ...

Copilot uses AI. Check for mistakes.
@Goooler Goooler closed this Nov 30, 2025
@Goooler Goooler deleted the g/20251201/zip-64-error branch November 30, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants