Skip to content

Commit d719bd5

Browse files
committed
correctly parse expect errrors in create, restore and unlock
1 parent c19d52a commit d719bd5

File tree

1 file changed

+7
-1
lines changed
  • images/utils/launcher/node

1 file changed

+7
-1
lines changed

images/utils/launcher/node/xud.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def extract_exception(self, cmd: str, output: str):
151151
raise PasswordNotMatch
152152
elif "xud was initialized without a seed because no wallets could be initialized" in output:
153153
raise NoWalletsInitialized
154+
elif "Error: " in output:
155+
raise FatalError("Failed to create wallets")
154156
elif "it is your ONLY backup in case of data loss" in output:
155157
return
156158
else:
@@ -163,16 +165,20 @@ def extract_exception(self, cmd: str, output: str):
163165
raise PasswordNotMatch
164166
elif "Mnemonic must be exactly 24 words" in output:
165167
raise MnemonicNot24Words
168+
elif "Error: " in output:
169+
raise FatalError("Failed to restore wallets")
166170
elif "The following wallets were restored" in output:
167171
return
168172
else:
169173
print("^C")
170174
raise KeyboardInterrupt
171175
elif cmd.startswith("unlock"):
172-
if "xud was unlocked succesfully" in output:
176+
if "xud was unlocked successfully" in output:
173177
return
174178
elif "password is incorrect" in output:
175179
raise WrongPassword
180+
elif "Error: " in output:
181+
raise FatalError("Failed to unlock wallets")
176182
else:
177183
print("^C")
178184
raise KeyboardInterrupt()

0 commit comments

Comments
 (0)