cinecert / asdcplib

AS-DCP and AS-02 File Access Library
Other
73 stars 55 forks source link

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

Open kblinova opened 4 years ago

kblinova commented 4 years ago

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.