public void ApproveAssignment(string AssignmentId, string feedback) { bool redo = false; int limit = 10; int count = 0; do { try { client.ApproveAssignment(AssignmentId, feedback); } catch (Amazon.WebServices.MechanicalTurk.Exceptions.InsufficientFundsException) { Console.WriteLine("NoT Enough Funds!!!"); } catch (Amazon.WebServices.MechanicalTurk.Exceptions.InvalidParameterValueException) { Console.WriteLine("Invalid Parameter Value!!!"); } catch (Amazon.WebServices.MechanicalTurk.Exceptions.AccessKeyException) { Console.WriteLine("Invalid Access Key Exception!!!"); } catch (Amazon.WebServices.MechanicalTurk.Exceptions.InvalidTransportEndpointException) { Console.WriteLine("Invalid Transport end point!!!"); } catch (Amazon.WebServices.MechanicalTurk.Exceptions.ObjectDoesNotExistException) { //Console.WriteLine(e.ToString()); Console.WriteLine(AssignmentId + " does not exist in Amazon"); return; } catch (Amazon.WebServices.MechanicalTurk.Exceptions.InvalidStateException) { //Console.WriteLine(e.ToString()); Console.WriteLine(AssignmentId + "already approved"); return; } catch (Amazon.WebServices.MechanicalTurk.Exceptions.ServiceException) { redo = true; count++; } } while (redo && count < limit); }