/// caught before than some
try {
status = func();
- } catch (nntrainer::exception::invalid_property &e) {
+ } catch (nntrainer::exception::not_supported &e) {
ml_loge("%s %s", typeid(e).name(), e.what());
return ML_ERROR_INVALID_PARAMETER;
} catch (std::invalid_argument &e) {
* @param[in] type property type to be passed
* @param[in] value value to be passed, if empty string is passed, do nothing
* but throws error when @a type is invalid
- * @exception std::out_of_range when property type is not valid for the
- * particular layer
- * @exception exception::invalid_property invalid argument
+ * @exception exception::not_supported when property type is not valid for
+ * the particular layer
+ * @exception std::invalid_argument invalid argument
*/
virtual void setProperty(const PropertyType type,
const std::string &value = "");
namespace exception {
/**
- * @brief derived class of invalid argument to represent property is invalid
+ * @brief derived class of invalid argument to represent specific functionality
+ * not supported
+ * @note this could be either intended or not yet implemented
*/
-struct invalid_property : public std::invalid_argument {
+struct not_supported : public std::invalid_argument {
using invalid_argument::invalid_argument;
};
void FlattenLayer::setProperty(const PropertyType type,
const std::string &value) {
- throw exception::invalid_property(
- "[Flatten Layer] setProperty not supported");
+ throw exception::not_supported("[Flatten Layer] setProperty not supported");
}
void FlattenLayer::copy(std::shared_ptr<Layer> l) {
default:
std::string msg =
"[Layer] Unknown Layer Property Key for value" + std::string(value);
- throw exception::invalid_property(msg);
+ throw exception::not_supported(msg);
}
}
const T target) {
try {
setProperty(type);
- } catch (exception::invalid_property &e) {
+ } catch (exception::not_supported &e) {
return;
}
}
void LossLayer::setProperty(const PropertyType type, const std::string &value) {
- throw exception::invalid_property("[Loss Layer] setProperty not supported");
+ throw exception::not_supported("[Loss Layer] setProperty not supported");
}
} /* namespace nntrainer */
/**! @todo: add following negative tc after #319
* 1. layer has empty prop -> throw std::invalid_argument
- * 2. layer has not allowed property -> throw exception::invalid_property
+ * 2. layer has not allowed property -> throw exception::not_supported
* 3. property value parse error -> throw std::invalid_argument
*/
if (!strncmp(value.c_str(), unknown, unknown_len)) {