From 21fd3f6c1dae80044e8f4ca064d2ef74a2c6da29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 25 Nov 2019 12:13:41 +0900 Subject: [PATCH] [moco-svc] Refine error with oops (#9154) This will refine error message with oops Signed-off-by: SaeHie Park --- compiler/moco/service/CMakeLists.txt | 1 + compiler/moco/service/src/Service/TFShapeInferenceRule.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/moco/service/CMakeLists.txt b/compiler/moco/service/CMakeLists.txt index bf4270f..dff0233 100644 --- a/compiler/moco/service/CMakeLists.txt +++ b/compiler/moco/service/CMakeLists.txt @@ -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) diff --git a/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp b/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp index cf253db..a7b69df 100644 --- a/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp +++ b/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp @@ -24,6 +24,8 @@ #include #include +#include + #include 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 -- 2.7.4