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

RuntimeError exception should not be used in as_02_IAB.cpp #60

Open
kblinova opened this issue Aug 18, 2020 · 0 comments
Open

RuntimeError exception should not be used in as_02_IAB.cpp #60

kblinova opened this issue Aug 18, 2020 · 0 comments

Comments

@kblinova
Copy link

Except for a couple of functions that do not return Result_t all other functions do and it does not make any sense to have statements like this one

if (result.Failure()) {
throw Kumu::RuntimeError(result);
}
when all that is required is to just return result;

Such functions like OP1Header() and RIP() could return empty respective structures in case of invalid state. If it is better to detect error state and interrupt processing, these functions could be converted to the following signatures:

From:

virtual const ASDCP::MXF::RIP& RIP() const;
virtual const ASDCP::MXF::OP1aHeader& OP1aHeader() const;

To:

virtual Result_t RIP(ASDCP::MXF::RIP&) const;
virtual Result_t OP1aHeader(ASDCP::MXF::OP1aHeader&) const;

Otherwise, RuntimeError should not use used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant