def connection_error(error = :protocol_error, msg: nil, e: nil)
      goaway(error) unless @state == :closed || @state == :new

      @state, @error = :closed, error
      klass = error.to_s.split('_').map(&:capitalize).join
      msg ||= e && e.message
      backtrace = (e && e.backtrace) || []
      fail Error.const_get(klass), msg, backtrace
    end
def connection_error(error = :protocol_error, msg: nil, e: nil)
      goaway(error) unless @state == :closed || @state == :new

      @state, @error = :closed, error
      klass = error.to_s.split('_').map(&:capitalize).join
      msg ||= e && e.message
      backtrace = (e && e.backtrace) || []
      fail Error.const_get(klass), msg, backtrace
    end
Emit GOAWAY error indicating to peer that the connection is being
 aborted, and once sent, raise a local exception.

 @param error [Symbol]
 @option error [Symbol] :no_error
 @option error [Symbol] :internal_error
 @option error [Symbol] :flow_control_error
 @option error [Symbol] :stream_closed
 @option error [Symbol] :frame_too_large
 @option error [Symbol] :compression_error
 @param msg [String]