log.error("msg " + me.getMessage()); log.error("loc " + me.getLocalizedMessage()); log.error("cause " + me.getCause()); log.error("excep " + me); me.printStackTrace();
log.error("msg " + me.getMessage()); log.error("loc " + me.getLocalizedMessage()); log.error("cause " + me.getCause()); log.error("excep " + me); me.printStackTrace();
public byte[] getHeaderBytes() throws MqttPersistenceException { try { return getHeader(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
public byte[] getPayloadBytes() throws MqttPersistenceException { try { return getPayload(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
private MqttWireMessage restoreMessage(String key, MqttPersistable persistable) throws MqttException { final String methodName = "restoreMessage"; MqttWireMessage message = null; try { message = MqttWireMessage.createWireMessage(persistable); } catch (MqttException ex) { //@TRACE 602=key={0} exception log.fine(CLASS_NAME, methodName, "602", new Object[] {key}, ex); if (ex.getCause() instanceof EOFException) { // Premature end-of-file means that the message is corrupted if (key != null) { persistence.remove(key); } } else { throw ex; } } //@TRACE 601=key={0} message={1} log.fine(CLASS_NAME, methodName, "601", new Object[]{key,message}); return message; }
public byte[] getPayloadBytes() throws MqttPersistenceException { try { return getPayload(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
public byte[] getPayloadBytes() throws MqttPersistenceException { try { return getPayload(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
public byte[] getPayloadBytes() throws MqttPersistenceException { try { return getPayload(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
public byte[] getHeaderBytes() throws MqttPersistenceException { try { return getHeader(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
public byte[] getHeaderBytes() throws MqttPersistenceException { try { return getHeader(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
public byte[] getHeaderBytes() throws MqttPersistenceException { try { return getHeader(); } catch (MqttException ex) { throw new MqttPersistenceException(ex.getCause()); } }
@Override public void connect(String serverUri) throws IOException { if (client != null && client.isConnected()) { disconnect(); } Console.printText((String.format("Connect to %1$s", serverUri))); Console.printNewLine(); try { client = new org.eclipse.paho.client.mqttv3.MqttClient(serverUri, clientId, new MemoryPersistence()); client.connect(connectOptions); } catch (MqttException e) { String cause = e.getMessage(); if (e.getCause() != null) { cause = cause.concat(" : ").concat(e.getCause().getMessage()); } String errorMessage = String.format("Unable to establish an MQTT connection - %1$s", cause); throw new IOException(errorMessage, e); } }
case MqttException.REASON_CODE_CLIENT_EXCEPTION: String causeMessage; Throwable cause = mqttError.getCause(); if (cause != null) { causeMessage = cause.getMessage();
System.out.println("msg " + me.getMessage()); System.out.println("loc " + me.getLocalizedMessage()); System.out.println("cause " + me.getCause()); System.out.println("excep " + me); me.printStackTrace();
private MqttWireMessage restoreMessage(String key, MqttPersistable persistable) throws MqttException { final String methodName = "restoreMessage"; MqttWireMessage message = null; try { message = MqttWireMessage.createWireMessage(persistable); } catch (MqttException ex) { //@TRACE 602=key={0} exception log.fine(CLASS_NAME, methodName, "602", new Object[] {key}, ex); if (ex.getCause() instanceof EOFException) { // Premature end-of-file means that the message is corrupted if (key != null) { persistence.remove(key); } } else { throw ex; } } //@TRACE 601=key={0} message={1} log.fine(CLASS_NAME, methodName, "601", new Object[]{key,message}); return message; }
private MqttWireMessage restoreMessage(String key, MqttPersistable persistable) throws MqttException { final String methodName = "restoreMessage"; MqttWireMessage message = null; try { message = MqttWireMessage.createWireMessage(persistable); } catch (MqttException ex) { //@TRACE 602=key={0} exception log.fine(className, methodName, "602", new Object[] {key}, ex); if (ex.getCause() instanceof EOFException) { // Premature end-of-file means that the message is corrupted if (key != null) { persistence.remove(key); } } else { throw ex; } } //@TRACE 601=key={0} message={1} log.fine(className, methodName, "601", new Object[]{key,message}); return message; }
private MqttWireMessage restoreMessage(String key, MqttPersistable persistable) throws MqttException { final String methodName = "restoreMessage"; MqttWireMessage message = null; try { message = MqttWireMessage.createWireMessage(persistable); } catch (MqttException ex) { //@TRACE 602=key={0} exception log.fine(CLASS_NAME, methodName, "602", new Object[] {key}, ex); if (ex.getCause() instanceof EOFException) { // Premature end-of-file means that the message is corrupted if (key != null) { persistence.remove(key); } } else { throw ex; } } //@TRACE 601=key={0} message={1} log.fine(CLASS_NAME, methodName, "601", new Object[]{key,message}); return message; }
if (pahoException.getCause() instanceof UnknownHostException || pahoException.getCause() instanceof NoRouteToHostException || pahoException.getCause() instanceof InterruptedException || pahoException.getCause() instanceof SocketTimeoutException || pahoException.getCause() instanceof SocketException)
switch (e.getReasonCode()) { case MqttException.REASON_CODE_CLIENT_EXCEPTION: Throwable cause = e.getCause(); if (cause != null) { throw new JoynrDelayMessageException("MqttException: " + cause.getMessage());