error-recovery

Android background network error recovery

五迷三道 提交于 2019-12-08 13:41:38
Given an Android intent service whose job is do background network communication (e.g. make a REST call to synchronize data), when the intent service catches an IOException , what is a good practice for recovering from the error? Let's assume the amount of data transferred is small enough that we're content retry the network operation from scratch. If the device lost network connection, we want to be notified when connectivity is restored and try again. If we didn't lose connection, we assume the server or its network link is down, and want to try again after a delay. It is not critical to

Android background network error recovery

≯℡__Kan透↙ 提交于 2019-12-08 04:24:29
问题 Given an Android intent service whose job is do background network communication (e.g. make a REST call to synchronize data), when the intent service catches an IOException , what is a good practice for recovering from the error? Let's assume the amount of data transferred is small enough that we're content retry the network operation from scratch. If the device lost network connection, we want to be notified when connectivity is restored and try again. If we didn't lose connection, we assume

How to stop ANTLR from suppressing syntax errors?

蹲街弑〆低调 提交于 2019-12-07 20:40:46
问题 So I'm writing a compiler in Java using ANTLR, and I'm a little puzzled by how it deals with errors. The default behavior seems to be to print an error message and then attempt, by means of token insertion and such, to recover from the error and continue parsing. I like this in principle; it means that (in the best case) if the user has committed more than one syntax error, they'll get one message per error, but it'll mention all the errors instead of forcing them to recompile to discover the

How to stop ANTLR from suppressing syntax errors?

旧城冷巷雨未停 提交于 2019-12-06 09:24:18
So I'm writing a compiler in Java using ANTLR, and I'm a little puzzled by how it deals with errors. The default behavior seems to be to print an error message and then attempt, by means of token insertion and such, to recover from the error and continue parsing. I like this in principle; it means that (in the best case) if the user has committed more than one syntax error, they'll get one message per error, but it'll mention all the errors instead of forcing them to recompile to discover the next one. The default error message is fine for my purposes. The trouble comes when it's done reading

Is “Out Of Memory” A Recoverable Error?

て烟熏妆下的殇ゞ 提交于 2019-11-27 06:24:16
I've been programming a long time, and the programs I see, when they run out of memory, attempt to clean up and exit, i.e. fail gracefully. I can't remember the last time I saw one actually attempt to recover and continue operating normally. So much processing relies on being able to successfully allocate memory, especially in garbage collected languages, it seems that out of memory errors should be classified as non-recoverable. (Non-recoverable errors include things like stack overflows.) What is the compelling argument for making it a recoverable error? It really depends on what you're

Is “Out Of Memory” A Recoverable Error?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 11:59:07
问题 I\'ve been programming a long time, and the programs I see, when they run out of memory, attempt to clean up and exit, i.e. fail gracefully. I can\'t remember the last time I saw one actually attempt to recover and continue operating normally. So much processing relies on being able to successfully allocate memory, especially in garbage collected languages, it seems that out of memory errors should be classified as non-recoverable. (Non-recoverable errors include things like stack overflows.)