From eeacbc6b29fe1ab38471ed4362c0fdefd7298d19 Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Thu, 5 Jul 2018 17:07:34 +0530 Subject: [PATCH] repo: Reword min-free-space-size option's error strings It is important that we use user-friendly error strings. The reason being error strings are seen by users such as in GNOME Software's error banner. Closes: #1671 Approved by: jlebon --- src/libostree/ostree-repo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 53d5cfda..cae38e6d 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -2670,7 +2670,7 @@ min_free_space_size_validate_and_convert (OstreeRepo *self, g_autoptr(GMatchInfo) match = NULL; if (!g_regex_match (regex, min_free_space_size_str, 0, &match)) - return glnx_throw (error, "Failed to match '^[0-9]+[GMT]B$'"); + return glnx_throw (error, "It should be of the format '123MB', '123GB' or '123TB'"); g_autofree char *size_str = g_match_info_fetch (match, 1); g_autofree char *unit = g_match_info_fetch (match, 2); @@ -2693,7 +2693,7 @@ min_free_space_size_validate_and_convert (OstreeRepo *self, guint64 min_free_space = g_ascii_strtoull (size_str, NULL, 10); if (shifts > 0 && g_bit_nth_lsf (min_free_space, 63 - shifts) != -1) - return glnx_throw (error, "Integer overflow detected"); + return glnx_throw (error, "Value was too high"); self->min_free_space_mb = min_free_space << shifts;