aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-03-28 23:20:44 +0200
committersteckbrief <steckbrief@chefmail.de>2016-03-28 23:20:44 +0200
commit77b1f2138e19545a48ea93c97f8518a87b065831 (patch)
tree8e27fefdbe9b16991f2450f147aeee581337ec1b /src/main/java/eu
parent27ca7f72d158318076de59d60ccb28625f3bdbf7 (diff)
parent0c0676b7dbf87e24ebcc4714adfb10d91e3d72b8 (diff)
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java8
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
index 1377e6ae..e236cdc0 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
@@ -11,6 +11,7 @@ import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Scanner;
import javax.net.ssl.HttpsURLConnection;
@@ -154,6 +155,7 @@ public class HttpUploadConnection implements Transferable {
private void upload() {
OutputStream os = null;
+ InputStream errorStream = null;
HttpURLConnection connection = null;
PowerManager.WakeLock wakeLock = mHttpConnectionManager.createWakeLock("http_upload_"+message.getUuid());
try {
@@ -213,13 +215,17 @@ public class HttpUploadConnection implements Transferable {
mXmppConnectionService.resendMessage(message, delayed);
}
} else {
+ errorStream = connection.getErrorStream();
+ Logging.e("httpupload", "file upload failed: http code (" + code + ") " + new Scanner(errorStream).useDelimiter("\\A").next());
fail();
}
} catch (IOException e) {
- Logging.d(Config.LOGTAG, e.getMessage());
+ errorStream = connection.getErrorStream();
+ Logging.e("httpupload", "http response: " + new Scanner(errorStream).useDelimiter("\\A").next() + ", exception message: " + e.getMessage());
fail();
} finally {
StreamUtil.close(os);
+ StreamUtil.close(errorStream);
if (connection != null) {
connection.disconnect();
}
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index 2e2700e9..2568e4b9 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
@@ -364,7 +364,7 @@ public abstract class XmppActivity extends Activity {
mPrimaryTextColor = getResources().getColor(R.color.primaryText);
mSecondaryTextColor = getResources().getColor(R.color.secondaryText);
mTertiaryTextColor = getResources().getColor(R.color.black12);
- mColorRed = getResources().getColor(R.color.warning);
+ mColorRed = getResources().getColor(R.color.error);
mColorOrange = getResources().getColor(R.color.orange500);
mColorGreen = getResources().getColor(R.color.online);
mPrimaryColor = getResources().getColor(R.color.primary);