daohu527 / cyber_record

cyber_record offline parse tool
Apache License 2.0
52 stars 19 forks source link

Incorrect construction of RecordException #66

Open IvDmNe opened 3 months ago

IvDmNe commented 3 months ago

In case of broken .record file there is an attempt of creating RecordException object:

https://github.com/daohu527/cyber_record/blob/83656db63ab90be1e6104a12de07fef6fd3eb6eb/cyber_record/reader.py#L268

but it has overrided init function without accepting additional arguments: https://github.com/daohu527/cyber_record/blob/83656db63ab90be1e6104a12de07fef6fd3eb6eb/cyber_record/record_exception.py#L19

I suggest, that RecordException class should be left empty:

class RecordException(Exception):
    pass
daohu527 commented 3 months ago

@IvDmNe Yes, you are right, I want to create a custom exception to prompt the error message. You can submit a PR to fix it!

Here is an article explain well about python exception! https://realpython.com/python-raise-exception/