fix: preserve CLI exit codes, log tracebacks, sanitize search errors, validate fixture
This commit is contained in:
+11
-8
@@ -97,16 +97,19 @@ def cmd_mine(args):
|
||||
|
||||
|
||||
def cmd_search(args):
|
||||
from .searcher import search
|
||||
from .searcher import search, SearchError
|
||||
|
||||
palace_path = os.path.expanduser(args.palace) if args.palace else MempalaceConfig().palace_path
|
||||
search(
|
||||
query=args.query,
|
||||
palace_path=palace_path,
|
||||
wing=args.wing,
|
||||
room=args.room,
|
||||
n_results=args.results,
|
||||
)
|
||||
try:
|
||||
search(
|
||||
query=args.query,
|
||||
palace_path=palace_path,
|
||||
wing=args.wing,
|
||||
room=args.room,
|
||||
n_results=args.results,
|
||||
)
|
||||
except SearchError:
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def cmd_wakeup(args):
|
||||
|
||||
Reference in New Issue
Block a user