comparison Agendas/trunk/src/Agendas.Twitter/TwitterPublicador.cs @ 182:beeb48ddb44a

Warning con los errores que se guarden en el log del track de un evento durante una notificación (twitter, calendar, blog)
author nelopauselli
date Mon, 08 Aug 2011 21:57:10 -0300
parents 734d3f0853bf
children 9f61e8555114
comparison
equal deleted inserted replaced
181:6ee05ceea8c3 182:beeb48ddb44a
1 using System.Collections.Generic; 1 using System;
2 using System.Collections.Generic;
2 using System.Linq; 3 using System.Linq;
3 using AltNetHispano.Agendas.Configurations; 4 using AltNetHispano.Agendas.Configurations;
4 using AltNetHispano.Agendas.Domain; 5 using AltNetHispano.Agendas.Domain;
5 using AltNetHispano.Agendas.Twitter.Writers; 6 using AltNetHispano.Agendas.Twitter.Writers;
6 7
41 if (track.Logs.Any(l => l.Propietario == TrackLogPropietario.Twitter && l.Successful)) continue; 42 if (track.Logs.Any(l => l.Propietario == TrackLogPropietario.Twitter && l.Successful)) continue;
42 43
43 var twitt = BuildTwitt(track); 44 var twitt = BuildTwitt(track);
44 if (!string.IsNullOrWhiteSpace(twitt)) 45 if (!string.IsNullOrWhiteSpace(twitt))
45 { 46 {
46 string message; 47 try
47 bool success = _twitterAdapter.Update(twitt, out message); 48 {
48 track.LogAdd(new TrackLog(TrackLogPropietario.Twitter, message, track.Usuario, success)); 49 string message;
50 bool success = _twitterAdapter.Update(twitt, out message);
51 track.LogAdd(new TrackLog(TrackLogPropietario.Twitter, message, track.Usuario, success));
52 }
53 catch(Exception ex)
54 {
55 track.LogAdd(new TrackLog(TrackLogPropietario.Twitter, track.Usuario, ex));
56 }
49 } 57 }
50 } 58 }
51 } 59 }
52 60
53 private string BuildTwitt(Track track) 61 private string BuildTwitt(Track track)