fix: descriptive error messages and dead code removal#11
Draft
Koan-Bot wants to merge 1 commit into
Draft
Conversation
Bare `die` without a message gives zero diagnostic info when something goes wrong. Replace all silent `die` calls with messages that identify the method and the missing argument. Also removes the unused `_get_from_id` method from GetFromId.pm (the FIXME said "to delete once unused" — it was already unused, only `_get_from_id_spec` is called from spec-generated code). Adds error-path tests covering argument validation for image_from_uid, image_from_name, create_vm, look_by_id_or_name, and the constructor. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace all bare
diestatements with descriptive error messages and remove dead code.Why
Silent
die(without a message) gives users zero diagnostic info when something goes wrong — they seeDied at Images.pm line 40with no context about what argument was missing or what went wrong. This makes debugging OpenStack integration issues unnecessarily painful.How
die unless defined $uid→die "image_from_uid: uid is required"die unless ref $self→die "setup_method must be called as an instance method"die unless defined $method→die "query_filters_for: method is required"_get_from_id— the FIXME said "to delete once unused" and it was indeed unused (only_get_from_id_specis called from spec-generated code)Testing
t/error-handling.twith 10 tests covering argument validation for:image_from_uid,image_from_name,create_vm(5 required args),look_by_id_or_name, and the constructor.🤖 Generated with Claude Code
Quality Report
Changes: 5 files changed, 120 insertions(+), 29 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline