cnblogs.com的html文件

This commit is contained in:
2024-09-24 12:43:01 +08:00
parent 4cd62e360f
commit 5e60d01d9f
192 changed files with 15211 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<div class="cnblogs_code">
<pre><span style="color: #0000ff;">import</span><span style="color: #000000;"> org.springframework.web.bind.annotation.ControllerAdvice;
</span><span style="color: #0000ff;">import</span><span style="color: #000000;"> org.springframework.web.bind.annotation.ExceptionHandler;
</span><span style="color: #0000ff;">import</span><span style="color: #000000;"> org.springframework.web.bind.annotation.ResponseBody;
</span><span style="color: #008000;">/**</span><span style="color: #008000;">
* </span><span style="color: #808080;">@author</span><span style="color: #008000;"> dcrenl: 2020-10-12 19:47:39
</span><span style="color: #008000;">*/</span><span style="color: #000000;">
@ControllerAdvice
</span><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span><span style="color: #000000;"> GlobalExceptionHandler {
@ResponseBody
@ExceptionHandler(Exception.</span><span style="color: #0000ff;">class</span><span style="color: #000000;">)
</span><span style="color: #0000ff;">public</span><span style="color: #000000;"> String globalException(Exception ex) {
</span><span style="color: #0000ff;">return</span><span style="color: #000000;"> ex.getMessage();
}
}</span></pre>
</div>
<p>&nbsp;</p>
<p>本文参考https://www.cnblogs.com/magicalSam/p/7198420.html</p>