STDOUT WorkflowException issue
See original GitHub issueOk… stay with me here. I have a framework that interacts with different ‘node servers’ via STDIN and STDOUT and some other stuff.
I’m using your LIFXLAN module inside one of these node servers and it queries the light every 30 seconds. It creates a new class for each light and runs as a daemon.
My specific issue:
lifx = lifxlan.LifxLAN(None)
devices = lifx.get_lights()
for d in devices:
while True:
try:
power = True if d.get_power() == 65535 else False
except (lifxlan.device.WorkflowException):
print 'The device is offline'
time.sleep(30)
When I try to catch lifxlan.device.WorkflowException, no matter what I do it ALWAYS outputs to STDOUT. This actually breaks my framework. Instead of actually catching the exception, I get this to STDOUT:
WorkflowException: Did not receive <class 'lifxlan.msgtypes.LightStatePower'> in response to <class 'lifxlan.msgtypes.LightGetPower'>
My question is how the heck can I catch your custom exception from device.py without outputting to STDOUT? I’m sure it’s my ignorance, hope this is an easy question and I’m just missing something.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
misleading error message when string is passed where File is ...
When a string type parameter is passed and a File or Directory is expected, cwltool should tell the user that the input parameter...
Read more >Databricks notebook time out error when calling other ...
I fixed the problem by tuning the default spark configuration. I increase the executor heartbeat and the networko spark.executor.heartbeat ...
Read more >RE: Kaleo workflow Oracle 10g problem [SOLVED] - Forums
Hi again! We're using Liferay 6 without bundle, during the instalation we copied the kaleo-web.war from a bundle instalation to the new deploy...
Read more >UserTask running on OraBPEL 10.1.3 - Oracle Communities
Hi all.. I have some bpel process with user task, designed with Jdev 10.1.2 and correctly runnign into OracleBPEL 10.1.2 for JBoss .....
Read more >common-workflow-language/common-workflow-language
WorkflowException: Invalid job input record: test.yml:2:1: the `fastqs` field is ... Step_$(inputs.step)_QualityControl] outputs: info: type: stdout error: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The issue is in light.py:
I changed
print(e)
topass
and that stopped the message from printing, surprise surprise. Of course, the better design would be to raise all the way up through the module to the user’s code, because the user may want their application logic to be different if the light goes offline.There are actually a lot of places where the lifxlan code either silently catches an error or prints out the error message, which I agree is really obnoxious as a user. I’ll go through the code base and turn all those into re-raises. Then your code would be able to catch and handle the WorkflowException.
Thanks for pointing this out, in retrospect those were some pretty silly design decisions on my part. I’ll go through and make sure everywhere in the module where something gets printed out, it is only when the verbose flag has been intentionally set by the user.
I was very slow to respond on this. I really appreciate your efforts. This is an absolutely fantastic module.