akarneliuk / pygnmi

The pure Python implementation of the gNMI client.
https://training.karneliuk.com
BSD 3-Clause "New" or "Revised" License
129 stars 44 forks source link

Add error propagation from child thread to main thread #142

Closed rao-aneesh closed 11 months ago

rao-aneesh commented 11 months ago

A try/except block is added in the enqueue_updates method to catch any exceptions during the subscription process. These exceptions are stored in a new attribute self.error, making them accessible in the main thread.

As a result of this change, the caller should check self.error after each operation to handle any potential exceptions raised in the child thread.

rao-aneesh commented 11 months ago

Trying to solve this: https://github.com/akarneliuk/pygnmi/issues/104

jhanm12 commented 11 months ago

@brunoonovais Can you please check this.

akarneliuk commented 11 months ago

Looks ok @AscendedEntity , let's see how tests will work out.