1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-04 02:48:25 +01:00
phorge-phorge/src/applications/harbormaster/exception/HarbormasterMessageException.php
epriestley 4cffaa600b Rename "HarbormasterRestartException" to "HarbormasterMessageException"
Summary: Ref T13072. This exception is now raised by all of the message-sending code. Pretty straight find/replace.

Test Plan: Grepped for old class name, no hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21699
2021-07-21 14:17:00 -07:00

46 lines
827 B
PHP

<?php
final class HarbormasterMessageException extends Exception {
private $title;
private $body = array();
public function __construct($title, $body = null) {
$this->setTitle($title);
$this->appendParagraph($body);
parent::__construct(
pht(
'%s: %s',
$title,
$body));
}
public function setTitle($title) {
$this->title = $title;
return $this;
}
public function getTitle() {
return $this->title;
}
public function appendParagraph($description) {
$this->body[] = $description;
return $this;
}
public function getBody() {
return $this->body;
}
public function newDisplayString() {
$title = $this->getTitle();
$body = $this->getBody();
$body = implode("\n\n", $body);
return pht('%s: %s', $title, $body);
}
}