def _TranslateError(error, detail=''):
 if ((error >= taskqueue_service_pb.TaskQueueServiceError.DATASTORE_ERROR) and isinstance(error, int)):
  from google.appengine.api import datastore
  datastore_exception = datastore._DatastoreExceptionFromErrorCodeAndDetail((error - taskqueue_service_pb.TaskQueueServiceError.DATASTORE_ERROR), detail)
  class JointException(datastore_exception.__class__, DatastoreError, ):
   'There was a datastore error while accessing the queue.'
   __msg = (u'taskqueue.DatastoreError caused by: %s %s' % (datastore_exception.__class__, detail))
   def __str__(self):
    return JointException.__msg
  return JointException()
 else:
  exception_class = _ERROR_MAPPING.get(error, None)
  if exception_class:
   return exception_class(detail)
  else:
   return Error(('Application error %s: %s' % (error, detail)))

def _TranslateError ( error , detail = '' ) : if ( ( error >= taskqueue_service_pb . TaskQueueServiceError . DATASTORE_ERROR ) and isinstance ( error , int ) ) : from google . appengine . api import datastore datastore_exception = datastore . _DatastoreExceptionFromErrorCodeAndDetail ( ( error - taskqueue_service_pb . TaskQueueServiceError . DATASTORE_ERROR ) , detail ) class JointException ( datastore_exception . __class__ , DatastoreError , ) : __msg = ( u'taskqueue.DatastoreError caused by: %s %s' % ( datastore_exception . __class__ , detail ) ) def __str__ ( self ) : return JointException . __msg return JointException ( ) else : exception_class = _ERROR_MAPPING . get ( error , None ) if exception_class : return exception_class ( detail ) else : return Error ( ( 'Application error %s: %s' % ( error , detail ) ) )
translates a taskqueueserviceerror into an exception .