mirror of https://github.com/M66B/FairEmail.git
FFSend: check for server error
This commit is contained in:
parent
9b9c6cb6a2
commit
db342940c0
|
@ -18,6 +18,7 @@ import org.json.JSONException;
|
|||
import org.json.JSONObject;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
|
@ -94,6 +95,9 @@ public class FFSend {
|
|||
JSONObject jreply = new JSONObject(queue.remove(0));
|
||||
Log.i("FFSend reply=" + jreply);
|
||||
|
||||
if (jreply.has("error"))
|
||||
throw new IOException("Error: " + jreply.getString("error"));
|
||||
|
||||
result = jreply.getString("url") +
|
||||
"#" + Base64.encodeToString(secret, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP);
|
||||
Log.i("FFSend url=" + result);
|
||||
|
|
Loading…
Reference in New Issue