Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect construction of RecordException #66

Open
IvDmNe opened this issue Aug 8, 2024 · 1 comment
Open

Incorrect construction of RecordException #66

IvDmNe opened this issue Aug 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@IvDmNe
Copy link

IvDmNe commented Aug 8, 2024

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

raise RecordException('expecting {} bytes, read {}'.format(size, len(data)))

but it has overrided init function without accepting additional arguments:

def __init__(self) -> None:

I suggest, that RecordException class should be left empty:

class RecordException(Exception):
    pass
@daohu527
Copy link
Owner

daohu527 commented Aug 13, 2024

@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/

@daohu527 daohu527 added the bug Something isn't working label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants