ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
Failure.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Language\Activities
;
22
27
final
class
Failure
28
{
29
public
static
function
of
(\Throwable
$e
): \Exception
30
{
31
// is_int(): a PDOException carries its SQLSTATE as string, and '42S02' compares as 4xx
32
$code =
$e
->getCode();
33
if
(
$e
instanceof \Exception && is_int($code) && $code >= 400 && $code < 500) {
34
return
$e
;
35
}
36
37
return
new \RuntimeException(
'The activity could not be performed.'
, 500,
$e
);
38
}
39
}
ILIAS\Language\Activities\Failure
Error of maybePerformAs(): 4xx exceptions answer the call and pass unchanged, anything else is a defe...
Definition:
Failure.php:28
ILIAS\Language\Activities\Failure\of
static of(\Throwable $e)
Definition:
Failure.php:29
ILIAS\Language\Activities
Definition:
AddLanguageEntry.php:21
Vendor\Package\$e
$e
Definition:
example_cleaned.php:49
components
ILIAS
Language
src
Activities
Failure.php
Generated on Wed Nov 11 2026 23:07:06 for ILIAS by
1.9.4 (using
Doxyfile
)