阿里云OpenAPI 这种情况怎么处理?
AliyunAlertController error msg:java.lang.NullPointerException, s:[{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":292,"methodName":"encodeThrowable","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":308,"methodName":"completeThrowable","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":957,"methodName":"uniCompose","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture$UniCompose","fileName":"CompletableFuture.java","lineNumber":940,"methodName":"tryFire","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":488,"methodName":"postComplete","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":1990,"methodName":"completeExceptionally","nativeMethod":false},{"className":"darabonba.core.TeaAsyncHandler$RetryableExecutor","fileName":"TeaAsyncHandler.java","lineNumber":291,"methodName":"lambda$attemptExecute$0","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":774,"methodName":"uniWhenComplete","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture$UniWhenComplete","fileName":"CompletableFuture.java","lineNumber":750,"methodName":"tryFire","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":488,"methodName":"postComplete","nativeMethod":false},{"className":"java.util.concurrent.CompletableFuture","fileName":"CompletableFuture.java","lineNumber":1975,"methodName":"complete","nativeMethod":false},{"className":"com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClient$1","fileName":"ApacheAsyncHttpClient.java","lineNumber":133,"methodName":"completed","nativeMethod":false},{"className":"com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClient$1","fileName":"ApacheAsyncHttpClient.java","lineNumber":130,"methodName":"completed","nativeMethod":false},{"className":"org.apache.hc.core5.concurrent.BasicFuture","fileName":"BasicFuture.java","lineNumber":123,"methodName":"completed","nativeMethod":false},
response.thenAccept(resp -> {
// 处理返回值
});
// 捕获空指针异常
try {
log.info("AliyunAlertController response :{}", new Gson().toJson(resp));
} catch (NullPointerException e) {
// 处理空指针异常,例如记录日志或抛出自定义异常
e.printStackTrace();
}
CopyCopy
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。