mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 06:58:27 +03:00
Also RainLoop exceptions to RuntimeException
This commit is contained in:
parent
c94e38b297
commit
7f231ef24f
5 changed files with 6 additions and 11 deletions
|
|
@ -6,7 +6,7 @@ namespace RainLoop\Exceptions;
|
|||
* @category RainLoop
|
||||
* @package Exceptions
|
||||
*/
|
||||
class ClientException extends Exception
|
||||
class ClientException extends \RuntimeException
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace RainLoop\Exceptions;
|
||||
|
||||
class Exception extends \Exception {}
|
||||
|
|
@ -150,7 +150,7 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
|
|||
.'/.files/'.\sha1($sKey);
|
||||
|
||||
if ($bMkDir && !\is_dir(\dirname($sFilePath)) && !\mkdir(\dirname($sFilePath), 0700, true)) {
|
||||
throw new \RainLoop\Exceptions\Exception('Can\'t make storage directory "'.$sFilePath.'"');
|
||||
throw new \RuntimeException('Can\'t make storage directory "'.$sFilePath.'"');
|
||||
}
|
||||
|
||||
return $sFilePath;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class FileStorage implements \RainLoop\Providers\Storage\IStorage
|
|||
|
||||
if ($bMkDir && !empty($sFilePath) && !\is_dir($sFilePath) && !\mkdir($sFilePath, 0700, true))
|
||||
{
|
||||
throw new \RainLoop\Exceptions\Exception('Can\'t make storage directory "'.$sFilePath.'"');
|
||||
throw new \RuntimeException('Can\'t make storage directory "'.$sFilePath.'"');
|
||||
}
|
||||
|
||||
return $sFilePath;
|
||||
|
|
|
|||
|
|
@ -255,17 +255,17 @@ class Utils
|
|||
{
|
||||
$dir = \dirname($filename);
|
||||
if (!\is_dir($dir) && !\mkdir($dir, 0700, true)) {
|
||||
throw new Exceptions\Exception('Failed to create directory "'.$dir.'"');
|
||||
throw new \RuntimeException('Failed to create directory "'.$dir.'"');
|
||||
}
|
||||
if (false === \file_put_contents($filename, $data)) {
|
||||
throw new Exceptions\Exception('Failed to save file "'.$filename.'"');
|
||||
throw new \RuntimeException('Failed to save file "'.$filename.'"');
|
||||
}
|
||||
\clearstatcache();
|
||||
\chmod($filename, 0600);
|
||||
/*
|
||||
try {
|
||||
} catch (\Throwable $oException) {
|
||||
throw new Exceptions\Exception($oException->getMessage() . ': ' . \error_get_last()['message']);
|
||||
throw new \RuntimeException($oException->getMessage() . ': ' . \error_get_last()['message']);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue