[Straggler catch to pick up error calls while traversing JSON. prb@mult.ifario.us**20080725053657] { hunk ./src/Blog/Widgets/Delicious.hs 18 +import qualified Control.Exception as CE + hunk ./src/Blog/Widgets/Delicious.hs 261 - case parse_utf8_json $ unescape body of - Right (JSArray a) -> - return $ Just (unpack_json a) - Right _ -> - do { L.errorM log_handle $ "JSON response did not contain an array at the top level." - ; return Nothing } - Left err -> - do { L.errorM log_handle $ "Error parsing JSON: " ++ err - ; return Nothing } + ( case parse_utf8_json $ unescape body of + Right (JSArray a) -> + return $ Just (unpack_json a) + Right _ -> + do { L.errorM log_handle $ "JSON response did not contain an array at the top level." + ; return Nothing } + Left err -> + do { L.errorM log_handle $ "Error parsing JSON: " ++ err + ; return Nothing } ) + `CE.catch` + (\e -> do { L.errorM log_handle $ "Unable to traverse JSON: " ++ (show e) + ; L.debugM log_handle $ "JSON that caused the error: " ++ body + ; return Nothing } ) }