Change-Id: Ifbe7aec3bfa0f14c28e90ad69c0bbefef2ef884c
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
return BUNDLE_ERROR_INVALID_PARAMETER;
auto* h = reinterpret_cast<Bundle*>(b);
- *raw = reinterpret_cast<bundle_raw*>(h->Encode());
+ try {
+ *raw = reinterpret_cast<bundle_raw*>(h->Encode());
+ } catch (const Exception& e) {
+ *raw = nullptr;
+ return e.GetErrorCode();
+ }
+
*len = strlen(reinterpret_cast<char*>(*raw));
return BUNDLE_ERROR_NONE;
}