Skip to content
Browse files

Update README.md - wrap job processing in try-catch

  • Loading branch information...
1 parent 8f08ec2 commit 718af1813d53ba122768b119719e836359c7bc0e @dongle dongle committed Sep 21, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 README.md
View
14 README.md
@@ -34,10 +34,16 @@ YourAppDelegate.m
{
sleep(1); // This won't block the main thread. Yay!
- if ([[job objectForKey:@"task"] isEqualToString:@"success"]) {
- return EDQueueResultSuccess;
- } else if ([[job objectForKey:@"task"] isEqualToString:@"fail"]) {
- return EDQueueResultFail;
+ // Wrap your job processing in a try-catch. Always use protection!
+ @try {
+ if ([[job objectForKey:@"task"] isEqualToString:@"success"]) {
+ return EDQueueResultSuccess;
+ } else if ([[job objectForKey:@"task"] isEqualToString:@"fail"]) {
+ return EDQueueResultFail;
+ }
+ }
+ @catch (NSException *exception) {
+ return EDQueueResultCritical;
}
return EDQueueResultCritical;

0 comments on commit 718af18

Please sign in to comment.
Something went wrong with that request. Please try again.