mvc: throw on template reload issues in mutable service controller #6487

While this omits all other callers of "template reload" functionality
we would only like to be concerned with these GUI ones and migrate everything
to using a mutable controller (for maintenance reasons at the very last).

Only make a short hint to where the error is.  The service is not started
on purpose now.
This commit is contained in:
Franco Fichtner 2023-09-19 15:39:06 +02:00
parent 6393c5b577
commit 6af3ec2954

View File

@ -194,7 +194,10 @@ abstract class ApiMutableServiceControllerBase extends ApiControllerBase
}
if (!empty(static::$internalServiceTemplate)) {
$backend->configdRun('template reload ' . escapeshellarg(static::$internalServiceTemplate));
$result = trim($backend->configdpRun('template reload', [static::$internalServiceTemplate]) ?? '');
if ($result !== 'OK') {
throw new UserException(gettext('Template generation failed. See backend log for details.'));
}
}
if ($this->serviceEnabled()) {