Skip to content

Conversation

@bradhe
Copy link
Contributor

@bradhe bradhe commented Jan 16, 2026

Title says it all, we shoulnd't just blindly panic when there's an invalid manifest file in a package. This makes the caller decide what happened.

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 removes a panic in the package loading logic by changing from_unpacked_path to return a Result instead of unwrapping errors when reading manifest files. This allows callers to handle invalid manifest files gracefully rather than crashing.

Changes:

  • Modified from_unpacked_path to return Result<Self, Error> instead of Self
  • Replaced .unwrap() with ? operator for proper error propagation
Comments suppressed due to low confidence (1)

crates/tower-package/src/lib.rs:1

  • Corrected spelling of 'shoulnd't' to 'shouldn't'.
use config::Towerfile;

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

Copy link
Contributor

@sammuti sammuti left a comment

Choose a reason for hiding this comment

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

LGTM

parameters.push(Parameter {
name: p.name.clone(),
description: p.description.clone(),
description: Some(p.description.clone()),
Copy link
Member

Choose a reason for hiding this comment

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

Will this cause issues if p.description is None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it's not really used. Compiler told me so.

@bradhe bradhe merged commit 8582269 into develop Jan 16, 2026
5 checks passed
@bradhe bradhe deleted the tasks/handle-manifest-errors branch January 16, 2026 17:38
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.

4 participants