EbmlElement: don't catch exceptions when writing elements

This commit is contained in:
Moritz Bunkus 2015-01-04 15:05:42 +01:00
parent 38eee9f0d6
commit b1a4c9ac00
2 changed files with 16 additions and 18 deletions

View File

@ -2,6 +2,10 @@
* Released v1.3.1.
* EbmlElement::Render(): doesn't catch exceptions anymore. Instead
exceptions generated from the IOCallback class (e.g. if a write
failed) are propagated to the caller.
2014-12-21 Moritz Bunkus <moritz@bunkus.org>
* build system: switched the build system from hand-crafted

View File

@ -578,26 +578,20 @@ filepos_t EbmlElement::Render(IOCallback & output, bool bWithDefault, bool bKeep
{
assert(bValueIsSet || (bWithDefault && DefaultISset())); // an element is been rendered without a value set !!!
// it may be a mandatory element without a default value
try {
if (!bWithDefault && IsDefaultValue()) {
return 0;
}
#if defined(LIBEBML_DEBUG)
uint64 SupposedSize = UpdateSize(bWithDefault, bForceRender);
#endif // LIBEBML_DEBUG
filepos_t result = RenderHead(output, bForceRender, bWithDefault, bKeepPosition);
uint64 WrittenSize = RenderData(output, bForceRender, bWithDefault);
#if defined(LIBEBML_DEBUG)
if (static_cast<int64>(SupposedSize) != (0-1))
assert(WrittenSize == SupposedSize);
#endif // LIBEBML_DEBUG
result += WrittenSize;
return result;
} catch (std::exception & ex) {
// const char * What = ex.what();
assert(false); // we should never be here !
if (!bWithDefault && IsDefaultValue()) {
return 0;
}
#if defined(LIBEBML_DEBUG)
uint64 SupposedSize = UpdateSize(bWithDefault, bForceRender);
#endif // LIBEBML_DEBUG
filepos_t result = RenderHead(output, bForceRender, bWithDefault, bKeepPosition);
uint64 WrittenSize = RenderData(output, bForceRender, bWithDefault);
#if defined(LIBEBML_DEBUG)
if (static_cast<int64>(SupposedSize) != (0-1))
assert(WrittenSize == SupposedSize);
#endif // LIBEBML_DEBUG
result += WrittenSize;
return result;
}
/*!