mirror of
https://github.com/danog/ipc.git
synced 2024-11-26 20:15:05 +01:00
27 lines
647 B
PHP
27 lines
647 B
PHP
<?php
|
|
|
|
namespace Amp\Ipc;
|
|
|
|
/**
|
|
* Thrown in case server connection fails.
|
|
*/
|
|
final class IpcServerException extends \Exception
|
|
{
|
|
private const TYPE_MAP = [
|
|
IpcServer::TYPE_UNIX => 'UNIX',
|
|
IpcServer::TYPE_TCP => 'TCP',
|
|
IpcServer::TYPE_FIFO => 'FIFO',
|
|
];
|
|
public function __construct(
|
|
array $messages,
|
|
int $code = 0,
|
|
\Throwable $previous = null
|
|
) {
|
|
$message = "Could not create IPC server: ";
|
|
foreach ($messages as $type => $error) {
|
|
$message .= self::TYPE_MAP[$type].": $error; ";
|
|
}
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
}
|