Differential D17384 Diff 42163 src/infrastructure/cluster/exception/PhabricatorClusterNoHostForRoleException.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/cluster/exception/PhabricatorClusterNoHostForRoleException.php
- This file was added.
<?php | |||||
final class PhabricatorClusterNoHostForRoleException | |||||
extends Exception { | |||||
epriestley: I think we can `final` this. | |||||
public function __construct($role) { | |||||
parent::__construct(pht('Search cluster has no hosts for role "%s".', | |||||
$role)); | |||||
} | |||||
} | |||||
Done Inline ActionsThis doesn't return so it probably doesn't get the string back to the user. epriestley: This doesn't `return` so it probably doesn't get the string back to the user. | |||||
Done Inline Actions😁 20after4: 😁 | |||||
Done Inline ActionsInstead of using getExceptionTitle(), it's probably cleaner to just call parent::__construct(): public function __construct($role) { parent::__construct(pht('Search cluster has no hosts for role "%s".', $role)); } Then the exception will (string) cast normally, do something sensible for getMessage(), etc. Having a separate method might be helpful if we expected to generate this exception in one language and wanted to be able to render it in a different language, but I don't think that'll ever happen with something low-level like this. epriestley: Instead of using `getExceptionTitle()`, it's probably cleaner to just call `parent::__construct… |
I think we can final this.