mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
pycriu: prevent always appending "Unknown" to error messages
Regardless of the actual error message, "Unknown" was always appended to the end of the string, resulting in messages like: "DUMP failed: Error(3): No process with such pidUnknown". Fixed by changing standalone if statements to else-if blocks so "Unknown" is only added when no specific error condition matches. Signed-off-by: Andrii Herheliuk <andrii@herheliuk.com>
This commit is contained in:
parent
540c631dd0
commit
d5c81f8108
1 changed files with 6 additions and 7 deletions
|
|
@ -181,15 +181,14 @@ class CRIUExceptionExternal(CRIUException):
|
|||
if self.errno == errno.EBADRQC:
|
||||
s += "Bad options"
|
||||
|
||||
if self.typ == rpc.DUMP:
|
||||
if self.errno == errno.ESRCH:
|
||||
s += "No process with such pid"
|
||||
elif self.typ == rpc.DUMP and self.errno == errno.ESRCH:
|
||||
s += "No process with such pid"
|
||||
|
||||
if self.typ == rpc.RESTORE:
|
||||
if self.errno == errno.EEXIST:
|
||||
s += "Process with requested pid already exists"
|
||||
elif self.typ == rpc.RESTORE and self.errno == errno.EEXIST:
|
||||
s += "Process with requested pid already exists"
|
||||
|
||||
s += "Unknown"
|
||||
else:
|
||||
s += "Unknown"
|
||||
|
||||
return s
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue