Merge branch 'master' into ssh_agent_support

This commit is contained in:
2020-12-17 02:51:24 -06:00
3 changed files with 20 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import java.net.URI;
import com.google.common.io.ByteSource;
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import lombok.Data;
import net.monarchpass.piecannon.Server;
@@ -28,7 +29,11 @@ public class WebDavServer implements Server {
request.basicAuthentication(username, password);
}
request.send();
final HttpResponse response = request.send();
if (response.statusCode() >= 400) {
throw new RuntimeException(response.statusCode() + ": " + response.statusPhrase());
}
return target;
} catch (final IOException exception) {
throw new RuntimeException(exception);