mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-12-05 11:08:00 -05:00
fix(http): tell a missing snapshot API from its status, not from the error text
The error message carries the request path, so a snapshot named nightly404 turned a real server error into 'not available'. FlociException now carries the HTTP status and the snapshot commands ask that. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
7 files changed
+58
-7
No files matched your search
@@ -47,7 +47,7 @@ public class SnapshotDeleteCommand implements Callable<Integer> {
|
||||
printer.println(Ansi.green("Snapshot deleted:") + " " + name);
|
||||
return 0;
|
||||
} catch (FlociException e) {
|
||||
if (e.getMessage().contains("404") || e.getMessage().contains("501")) {
|
||||
if (e.endpointMissing()) {
|
||||
printer.error("Snapshot API not available on this server version.\n" +
|
||||
"Track progress: " + profile.serverRepo() + "/issues");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user