FFSend: check for server error

This commit is contained in:
M66B 2022-07-31 20:03:38 +02:00
parent 9b9c6cb6a2
commit db342940c0
1 changed files with 4 additions and 0 deletions

View File

@ -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);