lib/pipeline/base.rb in tracksperanto-2.10.0 vs lib/pipeline/base.rb in tracksperanto-2.11.0

- old
+ new

@@ -12,14 +12,22 @@ class DimensionsRequiredError < RuntimeError def message; "Width and height must be provided for this importer"; end end class NoTrackersRecoveredError < RuntimeError + def initialize(importer) + if importer.class.known_snags + @snags = "Also note that this particular format (%s) has the following snags: %s" % [importer.const_name, importer.snags] + end + end + def message; - "Could not recover any non-empty trackers from this file.\n" + - "Wrong import format maybe?\n" + - "Note that PFTrack will only export trackers from the solved segment of the shot."; + [ + "Could not recover any non-empty trackers from this file.", + "Wrong import format maybe?", + @snags + ].join("\n") end end # The base pipeline is the whole process of track conversion from start to finish. # The pipeline object organizes the import formats, scans them, @@ -163,10 +171,10 @@ importer.io = io_with_progress obuf = Obuf.new(Tracksperanto::YieldNonEmpty.new(importer)) report_progress(percent_complete = 50.0, "Validating #{obuf.size} imported trackers") - raise NoTrackersRecoveredError if obuf.size.zero? + raise NoTrackersRecoveredError.new(importer) if obuf.size.zero? report_progress(percent_complete, "Starting export") percent_per_tracker = (100.0 - percent_complete) / obuf.size