The fails list was initialized after the try-except block that appends to it, causing an UnboundLocalError when decoding fails. This commit moves the initialization before the try block to ensure the list exists when accessed.
The fails list was initialized after the try-except block that appends to it, causing an UnboundLocalError when decoding fails. This commit moves the initialization before the try block to ensure the list exists when accessed.