mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-12-05 11:08:00 -05:00
fix(http): keep snapshot names in one path segment and report odd server responses clearly
Snapshot names are URL-encoded and names that would change the path are refused; every trailing slash is stripped from the endpoint; a non-JSON body or a redirect gets a message that says so instead of a parser error; requests use HTTP/1.1. snapshot delete reports a missing snapshot API like save and load, save warns that --message is not sent yet, and export/import no longer cite a server version that does not exist. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
7 files changed
+234
-18
No files matched your search
@@ -47,7 +47,12 @@ public class SnapshotDeleteCommand implements Callable<Integer> {
|
||||
printer.println(Ansi.green("Snapshot deleted:") + " " + name);
|
||||
return 0;
|
||||
} catch (FlociException e) {
|
||||
printer.error("Failed to delete snapshot: " + e.getMessage());
|
||||
if (e.getMessage().contains("404") || e.getMessage().contains("501")) {
|
||||
printer.error("Snapshot API not available on this server version.\n" +
|
||||
"Track progress: " + profile.serverRepo() + "/issues");
|
||||
} else {
|
||||
printer.error("Failed to delete snapshot: " + e.getMessage());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user