Sha256: 6abb7ec86169542638f91dd86f0aa5645db206cbb048fa7ecee258d63153c17f

Contents?: true

Size: 808 Bytes

Versions: 2

Compression:

Stored size: 808 Bytes

Contents

module PerconaMigrator
  class Error < StandardError; end

  # Used when for whatever reason we couldn't get the spawned process'
  # status.
  class NoStatusError < Error
    def message
      'Status could not be retrieved'.freeze
    end
  end

  # Used when the spawned process failed by receiving a signal.
  # pt-online-schema-change returns "SIGSEGV (signal 11)" on failures.
  class SignalError < Error
    attr_reader :status

    # Constructor
    #
    # @param status [Process::Status]
    def initialize(status)
      super
      @status = status
    end

    def message
      status.to_s
    end
  end

  class CommandNotFoundError < Error
    def message
      'Please install pt-online-schema-change. Check: https://www.percona.com/doc/percona-toolkit for further details'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
percona_migrator-0.1.1 lib/percona_migrator/errors.rb
percona_migrator-1.0.0 lib/percona_migrator/errors.rb