api/schedule: yield a more informative exception if no operation is found
2 files changed, 8 insertions(+), 2 deletions(-)

M rework/api.py
M tests/test_monitor.py
M rework/api.py +4 -1
@@ 189,7 189,10 @@ def schedule(engine,
                 )
             raise ValueError('Ambiguous operation selection')
         if not len(opids):
-            raise Exception('No operation was found for these parameters')
+            raise Exception(
+                f'No operation was found for these parameters: '
+                f'operation=`{opname}` domain=`{domain}` host=`{host()}`'
+            )
         opid = opids[0][0]
         q = insert(
             'rework.task'

          
M tests/test_monitor.py +4 -1
@@ 77,7 77,10 @@ def test_basic_task_operations(engine, c
 
     with pytest.raises(Exception) as err:
         api.schedule(engine, 'no_such_task')
-    assert err.value.args[0] == 'No operation was found for these parameters'
+    assert scrub(err.value.args[0]) == (
+        'No operation was found for these parameters: '
+        'operation=`no_such_task` domain=`None` host=`<X>.<X>.<X>.<X>`'
+    )
 
 
 def test_monitor_step(engine, cleanup):