about summary refs log tree commit homepage
path: root/bin/mog
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-11-14 09:24:05 +0000
committerEric Wong <normalperson@yhbt.net>2011-11-14 09:24:05 +0000
commit46f51f4eaaef4e8f7b36fe5f881551099d5113b8 (patch)
tree95936625e1e14ea8439c9c44450b80ec642a1ee7 /bin/mog
parent431de2b3f7b3b80a8f6da01549f475cff945f2bb (diff)
downloadmogilefs-client-46f51f4eaaef4e8f7b36fe5f881551099d5113b8.tar.gz
Diffstat (limited to 'bin/mog')
-rwxr-xr-xbin/mog14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/mog b/bin/mog
index f8647b6..88b6d55 100755
--- a/bin/mog
+++ b/bin/mog
@@ -221,11 +221,15 @@ begin
       raise ArgumentError, "Too many arguments"
     end
 
-    paths = mg.get_paths(key)
-    if test[:e]
-      ok = !!(paths && paths.size > 0)
-    else
-      raise ArgumentError, "Unknown flag: -#{test.keys.first}"
+    begin
+      paths = mg.get_paths(key)
+      if test[:e]
+        ok = !!(paths && paths.size > 0)
+      else
+        raise ArgumentError, "Unknown flag: -#{test.keys.first}"
+      end
+    rescue MogileFS::Backend::UnknownKeyError
+      ok = false
     end
 
     truth or ok = ! ok