Op Thursday 4 Jun 2015 01:15 CEST schreef Ethan Furman:
> On 06/03/2015 01:37 PM, Mark Lawrence wrote:
>> On 03/06/2015 19:28, Ethan Furman wrote:
>>> On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
>>>
I kept the except. I like to see the message that went wrong. ;-)
>>>
>>> That's fine, but
On 06/03/2015 01:37 PM, Mark Lawrence wrote:
On 03/06/2015 19:28, Ethan Furman wrote:
On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
I kept the except. I like to see the message that went wrong. ;-)
That's fine, but then add a `raise` after you print the error so you can
see the reason that
On Thu, Jun 4, 2015 at 2:15 AM, Cecil Westerhof wrote:
>> And I'd also skip the bare except clause. If you get any sort of
>> exception, whether it's a bug, a failure from libturpial, a network
>> error, or anything else, your code will just terminate with a bland
>> and useless message. Much bett
On 03/06/2015 19:28, Ethan Furman wrote:
On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
I kept the except. I like to see the message that went wrong. ;-)
That's fine, but then add a `raise` after you print the error so you can
see the reason that message failed.
--
~Ethan~
Why bother in th
On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
I kept the except. I like to see the message that went wrong. ;-)
That's fine, but then add a `raise` after you print the error so you can see
the reason that message failed.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 2015-06-03 17:15, Cecil Westerhof wrote:
Op Wednesday 3 Jun 2015 15:29 CEST schreef Chris Angelico:
On Wed, Jun 3, 2015 at 10:27 PM, Cecil Westerhof wrote:
def send_message(account_id, message, max_tries,
terminate_program): error_msg = 'Something went wrong with: ' +
message not_send = Tr
Op Wednesday 3 Jun 2015 15:29 CEST schreef Chris Angelico:
> On Wed, Jun 3, 2015 at 10:27 PM, Cecil Westerhof wrote:
>> def send_message(account_id, message, max_tries,
>> terminate_program): error_msg = 'Something went wrong with: ' +
>> message not_send = True tries = 0 while not_send: try:
>>
On Wed, Jun 3, 2015 at 10:27 PM, Cecil Westerhof wrote:
> def send_message(account_id, message, max_tries, terminate_program):
> error_msg = 'Something went wrong with: ' + message
> not_send= True
> tries = 0
> while not_send:
> try:
>
I am using libturpial to post messages on Twitter. Sometimes I get a
libturpial.exceptions.ServiceOverCapacity.
It is a good idea to try it again then. For this I wrote the following
function:
def send_message(account_id, message, max_tries, terminate_program):
error_msg = 'Something