Skip to content
Snippets Groups Projects
Commit 18191294 authored by Jan Kuchař's avatar Jan Kuchař
Browse files

added basic readme

parent 01ce8081
Branches
Tags v0.1.0
No related merge requests found
Pipeline #13395 passed
# Suppressed exceptions for PHP
Suppressed exceptions are useful for aggregating more exceptions with unreliable resources.
You want to communicate that process failed, with following list of sibling exceptions that led to this error.
```php
$remoteSources = []; // classes representing unreliable remote sources
$exceptions = [];
foreach ($remoteSoures as $remoteSource) {
try {
$remoteSource->fetch(); // unrealiable
} catch (FetchingFailed $e) {
$exceptions[] = $e;
continue;
}
}
if (count($exceptions) > 0) {
$e = new ProcessingFailed();
$e->addSuppressed(...$exceptions);
throw $e;
}
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment