aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/smpp
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-15 11:51:29 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-15 11:51:29 +1200
commitfa26dd5f14a991f327c26517a645c6b4f77c4a73 (patch)
tree26477b69c3aeca4cba7b6947cf6973d762841cda /src/org/traccar/smpp
parent2fb444df86d56246a8b5cee515eb91490c8dee05 (diff)
downloadtrackermap-server-fa26dd5f14a991f327c26517a645c6b4f77c4a73.tar.gz
trackermap-server-fa26dd5f14a991f327c26517a645c6b4f77c4a73.tar.bz2
trackermap-server-fa26dd5f14a991f327c26517a645c6b4f77c4a73.zip
Provide error messages
Diffstat (limited to 'src/org/traccar/smpp')
-rw-r--r--src/org/traccar/smpp/ClientSmppSessionHandler.java8
-rw-r--r--src/org/traccar/smpp/SmppClient.java2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/smpp/ClientSmppSessionHandler.java b/src/org/traccar/smpp/ClientSmppSessionHandler.java
index 37882c76a..55c6cccc3 100644
--- a/src/org/traccar/smpp/ClientSmppSessionHandler.java
+++ b/src/org/traccar/smpp/ClientSmppSessionHandler.java
@@ -45,7 +45,7 @@ public class ClientSmppSessionHandler extends DefaultSmppSessionHandler {
@Override
public PduResponse firePduRequestReceived(PduRequest request) {
- PduResponse response = null;
+ PduResponse response;
try {
if (request instanceof DeliverSm) {
String sourceAddress = ((DeliverSm) request).getSourceAddress().getAddress();
@@ -53,7 +53,7 @@ public class ClientSmppSessionHandler extends DefaultSmppSessionHandler {
smppClient.mapDataCodingToCharset(((DeliverSm) request).getDataCoding()));
LOGGER.debug("SMS Message Received: " + message.trim() + ", Source Address: " + sourceAddress);
- boolean isDeliveryReceipt = false;
+ boolean isDeliveryReceipt;
if (smppClient.getDetectDlrByOpts()) {
isDeliveryReceipt = request.getOptionalParameters() != null;
} else {
@@ -65,8 +65,8 @@ public class ClientSmppSessionHandler extends DefaultSmppSessionHandler {
}
}
response = request.createResponse();
- } catch (Throwable error) {
- LOGGER.warn(null, error);
+ } catch (Exception error) {
+ LOGGER.warn("SMS receiving error", error);
response = request.createResponse();
response.setResultMessage(error.getMessage());
response.setCommandStatus(SmppConstants.STATUS_UNKNOWNERR);
diff --git a/src/org/traccar/smpp/SmppClient.java b/src/org/traccar/smpp/SmppClient.java
index d7e262c87..c9869cb9c 100644
--- a/src/org/traccar/smpp/SmppClient.java
+++ b/src/org/traccar/smpp/SmppClient.java
@@ -263,7 +263,7 @@ public class SmppClient implements SmsManager {
try {
sendMessageSync(destAddress, message, command);
} catch (MessageException | InterruptedException | IllegalStateException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("SMS sending error", error);
}
}
});