wangwei 7 年之前
父节点
当前提交
c36e2956dc

+ 4 - 1
examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/CoreExamWorkApp.java

@@ -33,6 +33,7 @@ import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLogFactory;
 import cn.com.qmth.examcloud.commons.base.logging.SLF4JImpl;
 import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
 import cn.com.qmth.examcloud.commons.web.redis.RedisClientImpl;
+import cn.com.qmth.examcloud.commons.web.support.CustomResponseErrorHandler;
 
 @ComponentScan(basePackages = {"com.qmth.commons", "cn.com.qmth"})
 @EntityScan(basePackages = {"com.qmth.commons", "cn.com.qmth"})
@@ -64,7 +65,9 @@ public class CoreExamWorkApp {
 	@Bean
 	@LoadBalanced
 	public RestTemplate restTemplate() {
-		return new RestTemplate();
+		RestTemplate restTemplate = new RestTemplate();
+		restTemplate.setErrorHandler(new CustomResponseErrorHandler());
+		return restTemplate;
 	}
 
 	@Bean