Files
2012-02-21 01:15:00 -05:00

1 line
3.8 KiB
JSON

[{"user_id": 1516, "stars": [], "topic_id": 19457, "date_created": 1302804964.995508, "message": "when the exception is raised, you'll get a backtrace in the terminal. all of those methods mentioned in the backtrace are places where you can rescue it.", "group_id": 109, "id": 688149}, {"user_id": 7794, "stars": [], "topic_id": 19457, "date_created": 1302803927.3885691, "message": "I'm trying to use libusb in ruby. My script runs fine, but if the USB device is unplugged, I want it to exit. I'm trying to catch an Errno exception, but I can't figure out where to catch it. It is thrown while other code is executing, because it's essentially an interrupt from the OS (i beleive). Does anyone know how to catch it?", "group_id": 109, "id": 687901}, {"user_id": 7794, "stars": [], "topic_id": 19457, "date_created": 1302805435.1028149, "message": "root@andvue-gw:~/ruby_driver# ruby andvue.rb \n\"Monnit\" \n\"M+ LINK\" \n\"100\" \n\"Sending: C5 07 00 21 01 00 01 5C 64 F7\" \n\"Received: C5 0C 00 23 3A 0A 00 00 05 00 0B CE 01 00 78\" \n[ 6618.848693] usb 1-2.4: USB disconnect, address 21 \n#<Errno::ENODEV: No such device - usb_interrupt_read> \n#<Errno::ENODEV: No such device - usb_interrupt_read> \n#<Errno::ENODEV: No such device - usb_interrupt_read> \n#<Errno::ENODEV: No such device - usb_interrupt_read> \n#<Errno::ENODEV: No such device - usb_interrupt_read> \n#<Errno::ENODEV: No such device - usb_interrupt_read> \n#<Errno::ENODEV: No such device - usb_interrupt_read>", "group_id": 109, "id": 688290}, {"user_id": 4374, "stars": [], "topic_id": 19457, "date_created": 1302806590.4849429, "message": "can you post the source to andvue.rb?", "group_id": 109, "id": 688512}, {"user_id": 4374, "stars": [], "topic_id": 19457, "date_created": 1302806607.676815, "message": "a link to it, rather :)", "group_id": 109, "id": 688517}, {"user_id": 4374, "stars": [], "topic_id": 19457, "date_created": 1302805223.110512, "message": "wrap your main code block in a begin ... rescue statement", "group_id": 109, "id": 688235}, {"user_id": 7794, "stars": [], "topic_id": 19457, "date_created": 1302805388.59743, "message": "tried that. nothing shows up", "group_id": 109, "id": 688284}, {"user_id": 1516, "stars": [], "topic_id": 19457, "date_created": 1302805808.5529981, "message": "hm. could you share a short example which fails?", "group_id": 109, "id": 688374}, {"user_id": 7794, "stars": [], "topic_id": 19457, "date_created": 1302808155.4970379, "message": "I can't post everything. We have a wrapper object for the USB. I can post parts of that... what do you think would be important?", "group_id": 109, "id": 688864}, {"user_id": 4374, "stars": [], "topic_id": 19457, "date_created": 1302809171.2595129, "message": "Glad you got it worked out :)", "group_id": 109, "id": 689137}, {"user_id": 7794, "stars": [], "topic_id": 19457, "date_created": 1302808266.576406, "message": "k... I think I found it. The wrapper (not written by me) catches them and puts them... so they weren't being passed down...", "group_id": 109, "id": 688885}, {"user_id": 12674, "stars": [], "topic_id": 19457, "date_created": 1302820411.3925569, "message": "Not sure if this would help but Kernel#at_exit would allow you to do something right before the app dies. http://www.ruby-doc.org/core/classes/Kernel.html#M001431", "group_id": 109, "id": 692021}]