21 lines
730 B
PHP
21 lines
730 B
PHP
<?php
|
|
|
|
namespace App\Process\Tester;
|
|
|
|
use RuntimeException;
|
|
|
|
/**
|
|
* Something inside a tester run tried to reach the real world (a database other than the run's own, the network
|
|
* without a scripted answer, the mailbox, another mailer or store). It is recorded in the run's ledger before it is
|
|
* thrown, so a run that swallowed it is still reported as aborted (docs/Prozessarchitektur/Architektur/04 §3.3).
|
|
*/
|
|
final class SandboxViolation extends RuntimeException
|
|
{
|
|
public static function record(string $kind, string $message): self
|
|
{
|
|
EffectLedger::record('violation', ['kind' => $kind, 'message' => $message]);
|
|
|
|
return new self('Prozess-Tester: unzulässiger Zugriff ('.$kind.'): '.$message);
|
|
}
|
|
}
|