소스 검색

less errbit reporting for common client errors

tags/v0.13.1
Jonathan Cobb 4 년 전
부모
커밋
1f941f3d3d
4개의 변경된 파일17개의 추가작업 그리고 9개의 파일을 삭제
  1. +8
    -1
      bubble-server/src/main/java/bubble/client/BubbleNodeClient.java
  2. +1
    -1
      bubble-server/src/main/java/bubble/service/cloud/NodeLauncher.java
  3. +4
    -4
      bubble-server/src/main/java/bubble/service/notify/NotificationInboxProcessor.java
  4. +4
    -3
      bubble-server/src/main/java/bubble/service/notify/NotificationService.java

+ 8
- 1
bubble-server/src/main/java/bubble/client/BubbleNodeClient.java 파일 보기

@@ -13,6 +13,7 @@ import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.entity.ContentType;
import org.cobbzilla.util.http.ApiConnectionInfo;
import org.cobbzilla.util.http.HttpRequestBean;
@@ -20,6 +21,8 @@ import org.cobbzilla.wizard.server.config.HttpConfiguration;

import java.io.IOException;
import java.io.InputStream;
import java.net.ConnectException;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -102,8 +105,12 @@ public class BubbleNodeClient extends BubbleApiClient {
try {
log.debug("execute: attempting request...");
return super.execute(client, request);

} catch (ConnectException | ConnectTimeoutException | UnknownHostException e) {
throw e;

} catch (Exception e) {
return die("execute("+request+"): error: "+e);
throw new IllegalStateException("execute("+request+"): error: "+e, e);
}
}



+ 1
- 1
bubble-server/src/main/java/bubble/service/cloud/NodeLauncher.java 파일 보기

@@ -33,7 +33,7 @@ public class NodeLauncher implements Runnable {
try {
for (int i=0; i<LAUNCH_MAX_RETRIES; i++) {
if (i > 0 && !launchMonitor.isRegistered(networkUuid)) {
die("NodeLauncher.run: no longer registered: "+networkUuid);
throw new IllegalStateException("NodeLauncher.run: no longer registered: "+networkUuid);
}
if (!lock.get().equals(newNodeRequest.getLock())) {
die("NodeLauncher.run: existingLock (" + lock.get() + ") is different than lock in NewNodeNotification: " + newNodeRequest.getLock());


+ 4
- 4
bubble-server/src/main/java/bubble/service/notify/NotificationInboxProcessor.java 파일 보기

@@ -22,10 +22,10 @@ import static org.cobbzilla.util.json.JsonUtil.json;
@AllArgsConstructor @Slf4j
public class NotificationInboxProcessor implements Runnable {

private ReceivedNotification n;
private Map<String, SynchronousNotification> syncRequests;
private BubbleConfiguration configuration;
private ReceivedNotificationDAO receivedNotificationDAO;
private final ReceivedNotification n;
private final Map<String, SynchronousNotification> syncRequests;
private final BubbleConfiguration configuration;
private final ReceivedNotificationDAO receivedNotificationDAO;

@Override public void run() {
try {


+ 4
- 3
bubble-server/src/main/java/bubble/service/notify/NotificationService.java 파일 보기

@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.net.ConnectException;
import java.net.UnknownHostException;
import java.util.List;
import java.util.Map;

@@ -122,17 +123,17 @@ public class NotificationService {
log.debug("_notify: <<<<< RECEIPT <<<<<< " + json(receipt, COMPACT_MAPPER) + " <<<<<<<<<<<<<<<<<<");
return receipt;

} catch (ConnectException | ConnectTimeoutException | ApiException e) {
} catch (ConnectException | ConnectTimeoutException | UnknownHostException | ApiException e) {
notification.setStatus(NotificationSendStatus.error);
notification.setException(e);
sentNotificationDAO.update(notification);
return die("_notify: " + e);
throw new IllegalStateException("_notify: "+shortError(e), e);

} catch (Exception e) {
notification.setStatus(NotificationSendStatus.error);
notification.setException(e);
sentNotificationDAO.update(notification);
return die("_notify: " + e, e);
return die("_notify: "+shortError(e), e);
}
}
}


불러오는 중...
취소
저장