I am facing a weird error that I don't know how to handle
so an object is created from a method
procesed_sequences = sequence.find(seq_in_list)
This procesed_sequences return an object:
In normal condition, when we call for loop on this procesed_sequences:
for seq in procesed_sequences:
record.append(seq)
It is giving an error at a specific seq
File "sequence.py", line 290, in run for seq in procesed_sequences:
File "/home/.local/lib/python3.6/site-packages/sequence_finder.py", line 34, in look_sequence
seq_start = row.index("1") # start of sequence
ValueError: '1' is not in list
if I try to print the seq object
for seq in procesed_sequences:
print(seq)
It will print all the seq object until the problematic one and fail
so I thought using try and except
try:
record.append(seq)
except:
print(f"This sequence is giving error in")
print(e)
However, the try and except doesn't work, it seems the error happened at the try part when seq object is generated, now there is no way for me to go access the sequence script atm, how do I just ask seq object to not get call in the procesed_sequences if it's giving error
Thank you