Skip to content

Logging error for failed connection causes crash #60

@martin-kar

Description

@martin-kar

Running ntrip_client, and losing Internet connection (even temporarily), will cause this line to run:

          self._logerr('Reconnect failed. Retrying in {} seconds'.format(self._port, self._baudrate, self.reconnect_attempt_wait_seconds))

self._baudrate might be undefined, and then we get

  File "/workspace/src/external/ntrip_client/src/ntrip_client/ntrip_base.py", line 67, in reconnect
    self._logerr('Reconnect failed. Retrying in {} seconds'.format(self._port, self._baudrate, self.reconnect_attempt_wait_seconds))
AttributeError: 'NTRIPClient' object has no attribute '_baudrate'

Even if self._baudrate is defined, the line is buggy. It would use produce a log saying ...Retrying in {self._port} seconds.

The line should really be

          self._logerr('Reconnect failed. Retrying in {} seconds'.format( self.reconnect_attempt_wait_seconds))

I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions