Module: FPM::Fry

Defined in:
lib/fpm/fry/ui.rb,
lib/fpm/fry/tar.rb,
lib/fpm/fry/exec.rb,
lib/fpm/fry/chroot.rb,
lib/fpm/fry/recipe.rb,
lib/fpm/fry/source.rb,
lib/fpm/fry/channel.rb,
lib/fpm/fry/command.rb,
lib/fpm/fry/detector.rb,
lib/fpm/fry/inspector.rb,
lib/fpm/fry/joined_io.rb,
lib/fpm/fry/with_data.rb,
lib/fpm/fry/source/dir.rb,
lib/fpm/fry/source/git.rb,
lib/fpm/fry/docker_file.rb,
lib/fpm/fry/command/cook.rb,
lib/fpm/fry/recipe/error.rb,
lib/fpm/fry/stream_parser.rb,
lib/fpm/fry/recipe/builder.rb,
lib/fpm/fry/source/archive.rb,
lib/fpm/fry/source/patched.rb,
lib/fpm/fry/block_enumerator.rb,
lib/fpm/fry/build_output_parser.rb

Defined Under Namespace

Modules: Detector, Exec, Plugin, Source, WithData Classes: BlockEnumerator, BuildOutputParser, Channel, Chroot, Client, Command, DockerFile, Inspector, JoinedIO, Recipe, StreamParser, Tar, UI

Class Method Summary collapse

Class Method Details

.WithData(ex, data) ⇒ Exception

Annotates an arbitrary exception with logable data.

Examples:

raise FPM::Fry::WithData("Something went wrong", key: "value")

Parameters:

  • ex (String, Exception)
  • data (Hash)

Returns:

  • (Exception)

    annotated exception



11
12
13
14
15
16
17
# File 'lib/fpm/fry/with_data.rb', line 11

def self.WithData(ex, data)
  if ex.kind_of? String
    ex = StandardError.new(ex)
  end
  ex.define_singleton_method(:data){ data }
  return ex
end