Skip to content

Commit 7e0cb8b

Browse files
committed
[#2947] Adding versionadded details
1 parent 81698fe commit 7e0cb8b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

components/filesystem.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@ The :class:`Symfony\\Component\\Filesystem\\Filesystem` class is the unique
2121
endpoint for filesystem operations::
2222

2323
use Symfony\Component\Filesystem\Filesystem;
24-
use Symfony\Component\Filesystem\Exception\IOException;
24+
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
2525

2626
$fs = new Filesystem();
2727

2828
try {
2929
$fs->mkdir('/tmp/random/dir/' . mt_rand());
30-
} catch (IOException $e) {
30+
} catch (IOExceptionInterface $e) {
3131
echo "An error occurred while creating your directory at ".$e->getPath();
3232
}
3333

34+
.. versionadded::
35+
36+
The ``IOExceptionInterface`` and its ``getPath`` method are new in Symfony
37+
2.4. Prior to 2.4, you would catch the ``IOException`` class.
38+
3439
.. note::
3540

3641
Methods :method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir`,
@@ -251,7 +256,7 @@ Error Handling
251256
--------------
252257

253258
Whenever something wrong happens, an exception implementing
254-
:class:`Symfony\\Component\\Filesystem\\Exception\\ExceptionInterface` and
259+
:class:`Symfony\\Component\\Filesystem\\Exception\\ExceptionInterface` or
255260
:class:`Symfony\\Component\\Filesystem\\Exception\\IOExceptionInterface` is thrown.
256261

257262
.. note::

0 commit comments

Comments
 (0)