Browse Source

未选择详情页模板

rambo 3 months ago
parent
commit
5da7fe84cc
2 changed files with 6 additions and 3 deletions
  1. 2 2
      python/api.py
  2. 4 1
      python/service/run_main.py

+ 2 - 2
python/api.py

@@ -355,8 +355,8 @@ async def process_handle_detail(request: Request, params: HandlerDetail):
             
     except UnicornException as e:
         await _handle_exception(e.msg, handler_result_folder)
-    # except Exception as e:
-    #     await _handle_exception(str(e), handler_result_folder)
+    except Exception as e:
+        await _handle_exception(str(e), handler_result_folder)
         
     return True
 

+ 4 - 1
python/service/run_main.py

@@ -474,7 +474,10 @@ class RunMain:
         print("temp_class====>", temp_class)
         print("temp_class====>", temp_name)
         # 获取所有文件夹基础数据内容  检查不满足要求的文件不满足要求移动到错误文件夹
-        need_view_list = temp_class[temp_name].need_view
+        try:
+          need_view_list = temp_class[temp_name].need_view
+        except KeyError as ke:
+          raise UnicornException("未选择详情页模板,请检查")
         _all_dir_info_data = get_all_dir_info_and_pic_info(
             image_dir, folder_name_list, need_view_list
         )