Sha256: d26d69519d46313cbea6bf423518eb92c8430bbc54f8fa96254366f47292fbed

Contents?: true

Size: 847 Bytes

Versions: 4

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true

module Tangle
  #
  # LoopError is raised when a looped edge is disallowed.
  #
  class LoopError < RuntimeError
    def initialize(reason = 'loops not allowed', *)
      super
    end
  end

  # MultiEdgeError is raised when multiple edges between a single pair of
  # vertices is disallowed.
  #
  class MultiEdgeError < RuntimeError
    def initialize(reason = 'multiedges not allowed', *)
      super
    end
  end

  # GraphError is raised when graph elements in an operation belong to
  # different graphs.
  #
  class GraphError < RuntimeError
    def initialize(reason = 'not in the same graph', *)
      super
    end
  end

  # CyclicError is raised when an edge cycle is disallowed.
  #
  class CyclicError < RuntimeError
    def initialize(reason = 'cycles not allowed', *)
      super
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tangle-0.11.0 lib/tangle/errors.rb
tangle-0.10.2 lib/tangle/errors.rb
tangle-0.10.1 lib/tangle/errors.rb
tangle-0.10.0 lib/tangle/errors.rb