mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
fix(caddy): check if http app fails to provision due to not configured or invalid configuration (#1774)
This commit is contained in:
@@ -62,7 +62,12 @@ func (f *FrankenPHPApp) Provision(ctx caddy.Context) error {
|
||||
}
|
||||
} else {
|
||||
// if the http module is not configured (this should never happen) then collect the metrics by default
|
||||
f.metrics = frankenphp.NewPrometheusMetrics(ctx.GetMetricsRegistry())
|
||||
if errors.Is(err, caddy.ErrNotConfigured) {
|
||||
f.metrics = frankenphp.NewPrometheusMetrics(ctx.GetMetricsRegistry())
|
||||
} else {
|
||||
// the http module failed to provision due to invalid configuration
|
||||
return fmt.Errorf("failed to provision caddy http: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user