protected function ensureCacheExists() { if (!$this->cacheExists()) { if (!$this->createCache()) { throw new Minimee_ErrorException(Craft::t('Minimee could not write to cache ' . $this->makePathToCacheFilename() . '.')); } } return $this; }