mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-09 17:41:36 +00:00
More useful exception when unexpected output encountered from a kitten
This commit is contained in:
parent
d689c21283
commit
0c88e11cd7
1 changed files with 5 additions and 2 deletions
|
|
@ -76,8 +76,11 @@ def launch(args):
|
|||
def deserialize(output):
|
||||
import json
|
||||
if output.startswith('OK: '):
|
||||
prefix, sz, rest = output.split(' ', 2)
|
||||
return json.loads(rest[:int(sz)])
|
||||
try:
|
||||
prefix, sz, rest = output.split(' ', 2)
|
||||
return json.loads(rest[:int(sz)])
|
||||
except Exception:
|
||||
raise ValueError('Failed to parse kitten output: {!r}'.format(output))
|
||||
|
||||
|
||||
def run_kitten(kitten, run_name='__main__'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue