snipem / gt7dashboard

Gran Turismo 7 Race Telemetry Dashboard
GNU General Public License v3.0
177 stars 30 forks source link

Error while connecting to XXXX:33739: 'GT7Communication' object has no attribute 'lap_callback_function' #16

Closed gediminasz closed 1 year ago

gediminasz commented 1 year ago

Feel free to close this issue if you are already aware of this., but I was testing out your dashboard and noticed it failing with the following error (IP hidden by me):

Error while connecting to XXXX:33739: 'GT7Communication' object has no attribute 'lap_callback_function'

After changing logging.info to logging.exception in the exception handler, I was able to obtain the stacktrace:

Error while connecting to XXXX:33739: 'GT7Communication' object has no attribute 'lap_callback_function'
Traceback (most recent call last):
  File "C:\Users\gedim\Developer\gt7dashboard\gt7dashboard\gt7communication.py", line 227, in run
    self.finish_lap()
  File "C:\Users\gedim\Developer\gt7dashboard\gt7dashboard\gt7communication.py", line 386, in finish_lap
    if self.lap_callback_function:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GT7Communication' object has no attribute 'lap_callback_function'

Lastly I was able to workaround it with this patch:

-if self.lap_callback_function:
+if hasattr(self, "lap_callback_function"):

P.S. I also just now realized that perhaps I should have used the 1.1 release rather than master.

snipem commented 1 year ago

I reverted the changes I made to the main branch. This should make the main branch functional identical with the 1.1 release. My newest changes are still in the "improvements" branch if you are interested.

Can you check if this solves your issue?

gediminasz commented 1 year ago

Just checked the main branch and yup, it works now. Thank you!