@Test public void testIsServerOfflineException() { assertTrue(isServerOfflineException(new Exception("Script error. (:0)"))); assertTrue(isServerOfflineException(new Exception("Error parsing JSON: SyntaxError: Unexpected token � in JSON at position 1"))); assertTrue(isServerOfflineException(new Exception("Error parsing JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data"))); assertFalse(isServerOfflineException(new Exception("test"))); assertFalse(isServerOfflineException(new Exception(""))); }
public static boolean isServerOfflineException(final Throwable throwable) { Throwable cause = throwable.getCause(); String message = throwable.getMessage(); List<String> messages = Arrays.asList( "Script error. (:0)", "Error parsing JSON: SyntaxError: Unexpected token � in JSON at position 1", "Error parsing JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data"); return cause == null && message != null && messages.stream().anyMatch(m -> message.equals(m)); }
DefaultWorkbenchErrorCallback { public static boolean isServerOfflineException(final Throwable throwable) { Throwable cause = throwable.getCause(); String message = throwable.getMessage(); List<String> messages = Arrays.asList( "Script error. (:0)", "Error parsing JSON: SyntaxError: Unexpected token � in JSON at position 1", "Error parsing JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data"); return cause == null && message != null && messages.stream().anyMatch(m -> message.equals(m)); } }
DefaultWorkbenchErrorCallback { public static boolean isServerOfflineException(final Throwable throwable) { Throwable cause = throwable.getCause(); String message = throwable.getMessage(); List<String> messages = Arrays.asList( "Script error. (:0)", "Error parsing JSON: SyntaxError: Unexpected token � in JSON at position 1", "Error parsing JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data"); return cause == null && message != null && messages.stream().anyMatch(m -> message.equals(m)); }  }
DefaultWorkbenchErrorCallback { public static boolean isServerOfflineException(final Throwable throwable) { Throwable cause = throwable.getCause(); String message = throwable.getMessage(); List<String> messages = Arrays.asList( "Script error. (:0)", "Error parsing JSON: SyntaxError: Unexpected token � in JSON at position 1", "Error parsing JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data"); return cause == null && message != null && messages.stream().anyMatch(m -> message.equals(m)); }  static boolean isKieServerForbiddenException(final Throwable throwable); static boolean isKieServerUnauthorizedException(final Throwable throwable); static boolean isInvalidBusContentException(final Throwable throwable); static boolean isServerOfflineException(final Throwable throwable); void error(final Throwable throwable); void queue(final Throwable throwable); void dequeue(); void processQueue(); }
DefaultWorkbenchErrorCallback { public static boolean isServerOfflineException(final Throwable throwable) { Throwable cause = throwable.getCause(); String message = throwable.getMessage(); List<String> messages = Arrays.asList( "Script error. (:0)", "Error parsing JSON: SyntaxError: Unexpected token � in JSON at position 1", "Error parsing JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data"); return cause == null && message != null && messages.stream().anyMatch(m -> message.equals(m)); }  static boolean isKieServerForbiddenException(final Throwable throwable); static boolean isKieServerUnauthorizedException(final Throwable throwable); static boolean isInvalidBusContentException(final Throwable throwable); static boolean isServerOfflineException(final Throwable throwable); void error(final Throwable throwable); void queue(final Throwable throwable); void dequeue(); void processQueue();  }