[moco-svc] Refine error with oops (#9154)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 25 Nov 2019 03:13:41 +0000 (12:13 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 25 Nov 2019 03:13:41 +0000 (12:13 +0900)
This will refine error message with oops

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/moco/service/CMakeLists.txt
compiler/moco/service/src/Service/TFShapeInferenceRule.cpp

index bf4270f..dff0233 100644 (file)
@@ -10,6 +10,7 @@ target_link_libraries(moco_service PUBLIC moco_lang)
 target_link_libraries(moco_service PRIVATE moco_support)
 target_link_libraries(moco_service PRIVATE nncc_common)
 target_link_libraries(moco_service PRIVATE stdex)
+target_link_libraries(moco_service PRIVATE oops)
 install(TARGETS moco_service DESTINATION lib)
 
 if(NOT ENABLE_TEST)
index cf253db..a7b69df 100644 (file)
@@ -24,6 +24,8 @@
 #include <loco/IR/NodeShape.h>
 #include <loco/Service/ShapeInference.h>
 
+#include <oops/UserExn.h>
+
 #include <cassert>
 
 namespace
@@ -172,7 +174,7 @@ public:
     if (!axis_available)
     {
       // TODO may need to refine error message
-      throw std::runtime_error("ConcatV2 node does not have axis input");
+      throw oops::UserExn("ConcatV2 node does not have axis input", node->name());
     }
 
     uint32_t axis_absolute = (axis_value >= 0) ? axis_value : (int32_t)a_rank + axis_value;
@@ -576,7 +578,7 @@ public:
 
       if (!is_valid_squeeze_dims())
       {
-        throw std::runtime_error("Fix shape for TFSqueeze: invalid squeeze dimension");
+        throw oops::UserExn("Invalid squeeze dimension", node->name());
       }
 
       // Resolve negative squeeze dimension