mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-29 23:05:34 +08:00
Java Client: throw exception when assign fails
This commit is contained in:
parent
2d237f7b50
commit
4d0b894d37
@ -1,5 +1,6 @@
|
|||||||
package seaweedfs.client;
|
package seaweedfs.client;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
import org.apache.http.client.methods.HttpPost;
|
import org.apache.http.client.methods.HttpPost;
|
||||||
@ -50,6 +51,11 @@ public class SeaweedWrite {
|
|||||||
.setTtlSec(0)
|
.setTtlSec(0)
|
||||||
.setPath(path)
|
.setPath(path)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
if (!Strings.isNullOrEmpty(response.getError())) {
|
||||||
|
throw new IOException(response.getError());
|
||||||
|
}
|
||||||
|
|
||||||
String fileId = response.getFileId();
|
String fileId = response.getFileId();
|
||||||
String auth = response.getAuth();
|
String auth = response.getAuth();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user