mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +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
|
* @category RainLoop
|
||||||
* @package Exceptions
|
* @package Exceptions
|
||||||
*/
|
*/
|
||||||
class ClientException extends Exception
|
class ClientException extends \RuntimeException
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @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);
|
.'/.files/'.\sha1($sKey);
|
||||||
|
|
||||||
if ($bMkDir && !\is_dir(\dirname($sFilePath)) && !\mkdir(\dirname($sFilePath), 0700, true)) {
|
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;
|
return $sFilePath;
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ class FileStorage implements \RainLoop\Providers\Storage\IStorage
|
||||||
|
|
||||||
if ($bMkDir && !empty($sFilePath) && !\is_dir($sFilePath) && !\mkdir($sFilePath, 0700, true))
|
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;
|
return $sFilePath;
|
||||||
|
|
|
||||||
|
|
@ -255,17 +255,17 @@ class Utils
|
||||||
{
|
{
|
||||||
$dir = \dirname($filename);
|
$dir = \dirname($filename);
|
||||||
if (!\is_dir($dir) && !\mkdir($dir, 0700, true)) {
|
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)) {
|
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();
|
\clearstatcache();
|
||||||
\chmod($filename, 0600);
|
\chmod($filename, 0600);
|
||||||
/*
|
/*
|
||||||
try {
|
try {
|
||||||
} catch (\Throwable $oException) {
|
} 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