{"id":64969,"date":"2025-05-03T16:55:28","date_gmt":"2025-05-03T08:55:28","guid":{"rendered":"https:\/\/fwq.ai\/blog\/64969\/"},"modified":"2025-05-03T16:55:28","modified_gmt":"2025-05-03T08:55:28","slug":"exceptionhandler-%e6%8d%95%e8%8e%b7%e5%bc%82%e5%b8%b8%ef%bc%8c%e4%bd%86%e4%bb%a3%e7%a0%81%e4%b8%ad-try-catch-%e6%97%a0%e6%b3%95%e6%8d%95%e8%8e%b7%ef%bc%9a%e4%b8%ba%e4%bb%80%e4%b9%88%ef%bc%9f-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/64969\/","title":{"rendered":"@ExceptionHandler \u6355\u83b7\u5f02\u5e38\uff0c\u4f46\u4ee3\u7801\u4e2d try-catch \u65e0\u6cd5\u6355\u83b7\uff1a\u4e3a\u4ec0\u4e48\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173097417562582.jpg\" class=\"aligncenter\" title=\"@ExceptionHandler \u6355\u83b7\u5f02\u5e38\uff0c\u4f46\u4ee3\u7801\u4e2d try-catch \u65e0\u6cd5\u6355\u83b7\uff1a\u4e3a\u4ec0\u4e48\uff1f\u63d2\u56fe\" alt=\"@ExceptionHandler \u6355\u83b7\u5f02\u5e38\uff0c\u4f46\u4ee3\u7801\u4e2d try-catch \u65e0\u6cd5\u6355\u83b7\uff1a\u4e3a\u4ec0\u4e48\uff1f\u63d2\u56fe\" \/><\/p>\n<p>\u5f02\u5e38\u88ab @excepionhandler \u5168\u5c40\u5f02\u5e38\u5904\u7406\u6355\u83b7\u5230\u4e86<\/p>\n<p>\u4e00\u4e2a\u5f02\u5e38\u6808\u4fe1\u606f\u4e2d\u5305\u542b\u4e86\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>at com.yhl.sys.bpm.service.impl.WpServiceImpl.startWp(WpServiceImpl.java:329) \n\u6b64\u5904\u4ee3\u7801\u6211\u6dfb\u52a0\u4e86try catch\uff0c\u4f46\u662f\u6ca1\u6709\u6355\u83b7\u5230<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ece\u5f02\u5e38\u6808\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u5f02\u5e38\u53d1\u751f\u5728 wpserviceimpl.startwp() \u65b9\u6cd5\u4e2d\u3002\u7531\u4e8e\u6ca1\u6709\u63d0\u4f9b\u8be5\u65b9\u6cd5\u7684\u4ee3\u7801\uff0c\u56e0\u6b64\u65e0\u6cd5\u786e\u5b9a\u4e3a\u4f55 try-catch \u5757\u6ca1\u6709\u6355\u83b7\u5230\u5f02\u5e38\u3002<\/p>\n<p>\u4e3a\u4e86\u8fdb\u4e00\u6b65\u8bca\u65ad\u95ee\u9898\uff0c\u9700\u8981\u68c0\u67e5\u4ee5\u4e0b\u65b9\u9762\uff1a<\/p>\n<ul>\n<li>\u786e\u4fdd try-catch \u5757\u653e\u7f6e\u5728 startwp() \u65b9\u6cd5\u7684\u6b63\u786e\u4f4d\u7f6e\uff08\u4f8b\u5982\uff0c\u5728\u65b9\u6cd5\u629b\u51fa\u5f02\u5e38\u7684\u4ee3\u7801\u8def\u5f84\u4e0a\uff09\u3002<\/li>\n<li>\u68c0\u67e5\u4ee3\u7801\u662f\u5426\u5b58\u5728\u6216\u8fd0\u884c\u65f6\u5f02\u5e38\uff0c\u8fd9\u4e9b\u9519\u8bef\u6216\u5f02\u5e38\u53ef\u80fd\u963b\u6b62 try-catch \u5757\u6b63\u5e38\u8fd0\u884c\u3002<\/li>\n<li>\u68c0\u67e5\u5f02\u5e38\u7c7b\u578b\u662f\u5426\u4e0e try-catch \u5757\u4e2d\u58f0\u660e\u7684\u5f02\u5e38\u7c7b\u578b\u5339\u914d\u3002<\/li>\n<li>\u786e\u4fdd finally \u5757\u4e0d\u4f1a\u610f\u5916\u5730\u8986\u76d6\u6216\u541e\u6ca1\u5f02\u5e38\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f@ExceptionHandler \u6355\u83b7\u5f02\u5e38\uff0c\u4f46\u4ee3\u7801\u4e2d try-catch \u65e0\u6cd5\u6355\u83b7\uff1a\u4e3a\u4ec0\u4e48\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8IDCBABY\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f02\u5e38\u88ab @excepionhandler \u5168\u5c40\u5f02\u5e38\u5904\u7406\u6355\u83b7\u5230\u4e86 \u4e00\u4e2a\u5f02\u5e38\u6808\u4fe1\u606f\u4e2d\u5305\u542b\u4e86\u5982\u4e0b\u5185\u5bb9\uff1a at com.yhl.sys.bpm.service.impl.WpServiceImpl.startWp(WpServiceImpl.java:329) \u6b64\u5904\u4ee3\u7801\u6211\u6dfb\u52a0\u4e86try catch\uff0c\u4f46\u662f\u6ca1\u6709\u6355\u83b7\u5230 \u767b\u5f55\u540e\u590d\u5236 \u4ece\u5f02\u5e38\u6808\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u5f02\u5e38\u53d1\u751f\u5728 wpserviceimpl.startwp() \u65b9\u6cd5\u4e2d\u3002\u7531\u4e8e\u6ca1\u6709\u63d0\u4f9b\u8be5\u65b9\u6cd5\u7684\u4ee3\u7801\uff0c\u56e0\u6b64\u65e0\u6cd5\u786e\u5b9a\u4e3a\u4f55 try-catch \u5757\u6ca1\u6709\u6355\u83b7\u5230\u5f02\u5e38\u3002 \u4e3a\u4e86\u8fdb\u4e00\u6b65\u8bca\u65ad\u95ee\u9898\uff0c\u9700\u8981\u68c0\u67e5\u4ee5\u4e0b\u65b9\u9762\uff1a \u786e\u4fdd try-catch \u5757\u653e\u7f6e\u5728 startwp() \u65b9\u6cd5\u7684\u6b63\u786e\u4f4d\u7f6e\uff08\u4f8b\u5982\uff0c\u5728\u65b9\u6cd5\u629b\u51fa\u5f02\u5e38\u7684\u4ee3\u7801\u8def\u5f84\u4e0a\uff09\u3002 \u68c0\u67e5\u4ee3\u7801\u662f\u5426\u5b58\u5728\u6216\u8fd0\u884c\u65f6\u5f02\u5e38\uff0c\u8fd9\u4e9b\u9519\u8bef\u6216\u5f02\u5e38\u53ef\u80fd\u963b\u6b62 try-catch \u5757\u6b63\u5e38\u8fd0\u884c\u3002 \u68c0\u67e5\u5f02\u5e38\u7c7b\u578b\u662f\u5426\u4e0e try-catch \u5757\u4e2d\u58f0\u660e\u7684\u5f02\u5e38\u7c7b\u578b\u5339\u914d\u3002 \u786e\u4fdd finally \u5757\u4e0d\u4f1a\u610f\u5916\u5730\u8986\u76d6\u6216\u541e\u6ca1\u5f02\u5e38\u3002 \u4ee5\u4e0a\u5c31\u662f@ExceptionHandler \u6355\u83b7\u5f02\u5e38\uff0c\u4f46\u4ee3\u7801\u4e2d try-catch \u65e0\u6cd5\u6355\u83b7\uff1a\u4e3a\u4ec0\u4e48\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8IDCBABY\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-64969","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=64969"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64969\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=64969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=64969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=64969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}