diff --git a/lib/rscons.rb b/lib/rscons.rb index bffd205..eb9b4f3 100644 --- a/lib/rscons.rb +++ b/lib/rscons.rb @@ -35,8 +35,8 @@ module Rscons :SharedObject, ] - # Class to represent a fatal error while building a target. - class BuildError < RuntimeError; end + # Class to represent a fatal error during an Rscons operation. + class RsconsError < RuntimeError; end class << self diff --git a/lib/rscons/application.rb b/lib/rscons/application.rb index 85ce712..08973c3 100644 --- a/lib/rscons/application.rb +++ b/lib/rscons/application.rb @@ -136,8 +136,8 @@ module Rscons env.process end 0 - rescue BuildError => be - Ansi.write($stderr, :red, be.message, :reset, "\n") + rescue RsconsError => e + Ansi.write($stderr, :red, e.message, :reset, "\n") 1 end end @@ -193,7 +193,7 @@ module Rscons co = ConfigureOp.new(options) begin @script.configure(co) - rescue ConfigureOp::ConfigureFailure + rescue RsconsError Ansi.write($stderr, :red, "Configuration failed", :reset, "\n") rv = 1 end diff --git a/lib/rscons/configure_op.rb b/lib/rscons/configure_op.rb index 8f868bc..fe8d9a9 100644 --- a/lib/rscons/configure_op.rb +++ b/lib/rscons/configure_op.rb @@ -5,9 +5,6 @@ module Rscons # Class to manage a configure operation. class ConfigureOp - # Exception raised when a configuration error occurs. - class ConfigureFailure < Exception; end - # Create a ConfigureOp. # # @param options [Hash] @@ -407,7 +404,7 @@ module Rscons options[:on_fail].call end if should_fail - raise ConfigureFailure.new + raise RsconsError.new end end end diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index d2851b1..f0bef01 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -288,7 +288,7 @@ module Rscons if Cache.instance["failed_commands"].size > 0 msg += "\nUse -F to view the failed command log from the previous build operation" end - raise BuildError.new(msg) + raise RsconsError.new(msg) end end