module Travis
  class Hub
    class Exception

      attr_reader :event, :payload, :exception

      def initialize(event, payload, exception)
        @event = event
        @payload = payload
        @exception = exception
      end

      def message
        "env: #{Travis.env}\nevent: #{event.inspect}\npayload: #{payload.inspect}\n#{exception.message}"
      end

      def backtrace
        exception.backtrace
      end
    end
  end
end

module Travis
  class Hub
    class Exception < StandardError

      attr_reader :event, :payload, :exception

      def initialize(event, payload, exception)
        @event = event
        @payload = payload
        @exception = exception
      end

      def message
        "env: #{Travis.env}\nevent: #{event.inspect}\npayload: #{payload.inspect}\n#{exception.message}"
      end

      def backtrace
        exception.backtrace
      end
    end
  end
end

Revert "Revert "Hub::Exception should inherit from StandardError""
Revert "Revert "Hub::Exception should inherit from StandardError""

This reverts commit a1e6d4ccc8fb60c7b812c821b61efaab07ee80fc.
