Permalink
Browse files

rescued sending via socket, exception thrown by face recon...

  • Loading branch information...
1 parent 2f103b8 commit c7646afb87fd843c2306212ef6568f0209c282f2 Jake McGinty committed Mar 9, 2012
Showing with 5 additions and 2 deletions.
  1. +4 −2 lib/twitter-sentiment/output/send.rb
  2. +1 −0 lib/twitter-sentiment/parser/face_recon.rb
@@ -7,12 +7,12 @@
module TwitterSentiment
module Output
- include PurdyPrint #is this redundant?
+ include PurdyPrint
class Send
def initialize
pp :info, "Send module initialized successfully."
end
-
+
# Sends data to the music generator
# @param [Array] Data in pre-defined form (not in JSON)
# @return [nil]
@@ -21,6 +21,8 @@ def send_gen data = nil
streamSock = TCPSocket.new( "127.0.0.1", 9133 )
streamSock.write(payload)
streamSock.close
+ rescue Exception
+ pp :warn, "Failed to send payload across socket."
end
end #Send
end #Output
@@ -23,6 +23,7 @@ def smile_info info = ""
arr = []
info.each do |n|
n = n["attributes"]["smiling"]
+ next if n.nil?
arr << [n["value"],n["confidence"]]
end
arr

0 comments on commit c7646af

Please sign in to comment.