if storage not available gracefully fails, no error message for now
513874
function StorageHandle() {
  this.storageSupport = storageSupportAnalyse();
  switch (this.storageSupport) {
    case 0:
      var exec = require('cordova/exec');
      this.storageHandlerDelegate = exec;
      break;
    case 1:
      var localStorageHandle = require('./LocalStorageHandle');
      this.storageHandlerDelegate = localStorageHandle;
      break;
    case 2:
      console.log("ALERT! localstorage isn't supported");
      break;
    default:
      console.log("StorageSupport Error");
      break;
  }
}
1140427
def _check(self): # TODO: fix?
        """"""
        if self._returncode:
            rarfile.check_returncode(self, '')
        if self._remain != 0:
            raise rarfile.BadRarFile("Failed the read enough data")
761899
function (logicalPath, content, hasErrors) {
            var itm = this._cache.getItem("files", logicalPath, true);
            if (hasErrors) {
                itm.status = this._cache.STATUS_ERROR;
            } else {
                itm.value = content;
                itm.status = this._cache.STATUS_AVAILABLE;
            }
            if (this.lastLoadedFiles) {
                this.lastLoadedFiles[logicalPath] = 1;
            }
        }
744091
async def process_error_async(self, error):
        
        try:
            await self.eh_partition_pump.process_error_async(error)
        finally:
            self.eh_partition_pump.set_pump_status("Errored")
1066051
function sendError(error, params) {
    checkParams(params);
    
    params.status = FILE_NOT_FOUND;
    
    const data = error.message || String(error);
    
    logError(error.stack);
    
    send(data, params);
}
925423
async function asyncstorage(namespace) {
  var debug, diagnostics;

  try {
    debug = await storage.getItem('debug');
    diagnostics = await storage.getItem('diagnostics');
  } catch (e) {
    /* Nope, nothing. */
  }

  return enabled(namespace, debug || diagnostics || '');
}
1315469
def on_error(self, ex):
        
        if self._d:
            self._d.errback()
            self._d = None
1220365
def storage_enable(self, name, value=True, timeout=10):
        
        value = 'true' if value else 'false'
        result = Result(*self.perform_request(**{
            'method': 'GET',
            'url': '/storage/{0}/enable/{1}'.format(name, value),
            'params': {
                'request_timeout': timeout
            }
        }))
        return result
719253
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # async not supported yet
        # The URI is a POST operation, so we need to construct the SG URI
        storage_group_oid = uri_parms[0]
        storage_group_uri = '/api/storage-groups/' + storage_group_oid
        try:
            storage_group = hmc.lookup_by_uri(storage_group_uri)
        except KeyError:
            raise InvalidResourceError(method, uri)

        # TODO: Check that the SG is detached from any partitions

        # Reflect the result of deleting the storage_group
        storage_group.manager.remove(storage_group.oid)
1268624
function onStorageResponse (
  error, record, recordName, socketWrapper, onComplete, onError, options, context, metaData
) {
  if (error) {
    sendError(
      C.EVENT.RECORD_LOAD_ERROR,
      `error while loading ${recordName} from storage:${error.toString()}`,
      recordName,
      socketWrapper,
      onError,
      options,
      context,
      metaData
    )
  } else {
    onComplete.call(context, record || null, recordName, socketWrapper)

    if (record) {
      options.cache.set(recordName, record, () => {}, metaData)
    }
  }
}
1169583
def storage_get(attribute=None, storage_id=None):
    """"""
    _args = ['storage-get', '--format=json']
    if storage_id:
        _args.extend(('-s', storage_id))
    if attribute:
        _args.append(attribute)
    try:
        return json.loads(subprocess.check_output(_args).decode('UTF-8'))
    except ValueError:
        return None
304327
private void handleRetryForStorageException(final StorageException exs) throws StorageException {
    retries++;
    if (retries > maxRetries) {
      throw new StorageException(
          exs.getCode(),
          "All "
              + maxRetries
              + " retries failed. Waited a total of "
              + totalWaitTime
              + " ms between attempts",
          exs);
    }
    sleepForAttempt(retries);
  }
103631
private void checkTempBlockIdAvailable(long blockId) throws BlockAlreadyExistsException {
    if (mMetaManager.hasTempBlockMeta(blockId)) {
      throw new BlockAlreadyExistsException(ExceptionMessage.TEMP_BLOCK_ID_EXISTS, blockId);
    }
    if (mMetaManager.hasBlockMeta(blockId)) {
      throw new BlockAlreadyExistsException(ExceptionMessage.TEMP_BLOCK_ID_COMMITTED, blockId);
    }
  }
592817
protected static function fail() {
		if (\Skeleton\Core\Hook::exists('media_not_found')) {
			\Skeleton\Core\Hook::call('media_not_found');
		} else {
			HTTP\Status::code_404('media');
		}
	}
1144287
def retryable_writes_supported(self):
        """"""
        return (
            self._ls_timeout_minutes is not None and
            self._server_type in (SERVER_TYPE.Mongos, SERVER_TYPE.RSPrimary))
848354
def do_execute(self):
        
        if self.storagehandler is None:
            return "No storage handler available!"
        sname = str(self.resolve_option("storage_name"))
        if sname not in self.storagehandler.storage:
            return "No storage item called '" + sname + "' present!"
        self._output.append(Token(self.storagehandler.storage[sname]))
        return None
327835
function(errorMessage) {
                    var errorResponse = {};

                    if (errorMessage) {
                        errorResponse.error = errorMessage;
                    }

                    log(qq.format("Failed to generate blob for ID {}.  Error message: {}.", id, errorMessage), "error");

                    options.onComplete(id, options.getName(id), qq.extend(errorResponse, preventRetryResponse), null);
                    upload.maybeSendDeferredFiles(id);
                    connectionManager.free(id);
                }