Class: Dockerspec::DockerExceptionParser

Inherits:
Object
  • Object
show all
Defined in:
lib/dockerspec/docker_exception_parser.rb

Overview

A class to parse Docker::Error exceptions.

Instance Method Summary collapse

Constructor Details

#initialize(e) ⇒ DockerExceptionParser

Parses Docker exceptions.

Raises the same exception if the format is unknown.

Examples:

rescue ::Docker::Error::DockerError => e
  DockerExceptionParser.new(e)
end

Parameters:

  • e (Exception)

    The exception object to parse.

Raises:

  • (Dockerspec::DockerError)

    When the exception format is known.

  • (Exception)

    When the exception format is unknown.



45
46
47
48
49
# File 'lib/dockerspec/docker_exception_parser.rb', line 45

def initialize(e)
  e_ary = parse_exception(e)
  raise_docker_error_exception(e_ary)
  raise e
end