Skip to content

Commit 209271e

Browse files
author
litongjava
committed
update GlobalExceptionHadler
1 parent 2fa95c9 commit 209271e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/zh/99_案例/02.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ import com.litongjava.tio.utils.environment.EnvironmentUtils;
145145
import com.litongjava.tio.utils.network.IpUtils;
146146
import com.litongjava.tio.utils.notification.NotifactionWarmModel;
147147
import com.litongjava.tio.utils.notification.NotificationUtils;
148-
import okhttp3.Response;
149148
150149
import lombok.extern.slf4j.Slf4j;
150+
import okhttp3.Response;
151151
152152
@Slf4j
153153
public class GlobalExceptionHadler implements TioBootExceptionHandler {
@@ -177,9 +177,8 @@ public class GlobalExceptionHadler implements TioBootExceptionHandler {
177177
model.setTime(new Date());
178178
model.setContent(requestURL + "\n" + stackTrace);
179179
180-
Response response = NotificationUtils.sendWarm(model);
181-
//close response
182-
response.close();
180+
try (Response response = NotificationUtils.sendWarm(model)) {
181+
}
183182
184183
}
185184
}

0 commit comments

Comments
 (0)