Commit 3f0c84f9 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Cleaned a bit Exception use in IconTheme

Showing with 5 additions and 2 deletions
+5 -2
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
class ThemeFileParsingException extends Exception;
class IconThemeDir class IconThemeDir
{ {
private $Size; private $Size;
...@@ -83,7 +85,7 @@ class IconTheme ...@@ -83,7 +85,7 @@ class IconTheme
$this->path = $folder; $this->path = $folder;
$datas = @parse_ini_file($folder.'/index.theme', TRUE, INI_SCANNER_RAW); $datas = @parse_ini_file($folder.'/index.theme', TRUE, INI_SCANNER_RAW);
if ($datas === FALSE) { if ($datas === FALSE) {
throw new Exception('Error while parsing theme file'); throw new ThemeFileParsingException('Error while parsing theme file');
} }
if (isset($datas['Icon Theme']['Directories']) && !empty($datas['Icon Theme']['Directories'])) { if (isset($datas['Icon Theme']['Directories']) && !empty($datas['Icon Theme']['Directories'])) {
$dirs = preg_split('/,/', $datas['Icon Theme']['Directories']); $dirs = preg_split('/,/', $datas['Icon Theme']['Directories']);
...@@ -186,7 +188,8 @@ class IconTheme ...@@ -186,7 +188,8 @@ class IconTheme
} else { } else {
$themes[$file] = new IconTheme("$path/$file", static::$default_theme); $themes[$file] = new IconTheme("$path/$file", static::$default_theme);
} }
} catch (Exception $e) { } catch (ThemeFileParsingException $e) {
continue;
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment