lib/rallycat/cat.rb in rallycat-0.2.0 vs lib/rallycat/cat.rb in rallycat-0.3.0

- old
+ new

@@ -1,9 +1,10 @@ require 'nokogiri' module Rallycat class Cat + class StoryNotFound < StandardError; end def initialize(rally_api) @rally_api = rally_api end @@ -12,10 +13,12 @@ results = @rally_api.find(story_type, fetch: true) do equal :formatted_id, story_number end - return "Story (#{ story_number }) does not exist." if results.total_result_count == 0 + if results.total_result_count == 0 + raise StoryNotFound, "Story (#{ story_number }) does not exist." + end consolidate_newlines parse_story(results.first) end private