Skip to content

Errors reading or writing to serial port should just exit #8

@smcameron

Description

@smcameron

logger.Debug().Msgf("Error reading packet: %s", err)

If an error is encountered reading or writing to the serial port, the code currently makes no attempt at recovery and just tries again as fast as it can spamming the log. This approach is doomed, it will never recover this way. Recovery would involve closing the file, and periodically re-opening it and trying again, with some delay, and eventually giving up. Realistically, the reason for the error is that somebody unplugged it. It's never going to recover. So just exit if an error is encountered reading or writing to the serial port. This is miles better than spamming the logs with infinite noise.

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