@@ -244,12 +244,19 @@ public function updatedApplicationBaseDirectory()
244
244
245
245
public function updatedApplicationFqdn ()
246
246
{
247
- $ this ->application ->fqdn = str ($ this ->application ->fqdn )->replaceEnd (', ' , '' )->trim ();
248
- $ this ->application ->fqdn = str ($ this ->application ->fqdn )->replaceStart (', ' , '' )->trim ();
249
- $ this ->application ->fqdn = str ($ this ->application ->fqdn )->trim ()->explode (', ' )->map (function ($ domain ) {
250
- return str ($ domain )->trim ()->lower ();
251
- });
252
- $ this ->application ->fqdn = $ this ->application ->fqdn ->unique ()->implode (', ' );
247
+ try {
248
+ $ this ->application ->fqdn = str ($ this ->application ->fqdn )->replaceEnd (', ' , '' )->trim ();
249
+ $ this ->application ->fqdn = str ($ this ->application ->fqdn )->replaceStart (', ' , '' )->trim ();
250
+ $ this ->application ->fqdn = str ($ this ->application ->fqdn )->trim ()->explode (', ' )->map (function ($ domain ) {
251
+ return str ($ domain )->trim ()->lower ();
252
+ });
253
+ $ this ->application ->fqdn = $ this ->application ->fqdn ->unique ()->implode (', ' );
254
+ $ this ->application ->save ();
255
+ } catch (\Throwable $ e ) {
256
+ $ originalFqdn = $ this ->application ->getOriginal ('fqdn ' );
257
+ $ this ->application ->fqdn = $ originalFqdn ;
258
+ return handleError ($ e , $ this );
259
+ }
253
260
$ this ->resetDefaultLabels ();
254
261
}
255
262
@@ -288,18 +295,22 @@ public function getWildcardDomain()
288
295
289
296
public function resetDefaultLabels ()
290
297
{
291
- if ($ this ->application ->settings ->is_container_label_readonly_enabled ) {
292
- return ;
293
- }
294
- $ this ->customLabels = str (implode ('|coolify| ' , generateLabelsApplication ($ this ->application )))->replace ('|coolify| ' , "\n" );
295
- $ this ->ports_exposes = $ this ->application ->ports_exposes ;
296
- $ this ->is_container_label_escape_enabled = $ this ->application ->settings ->is_container_label_escape_enabled ;
297
- $ this ->application ->custom_labels = base64_encode ($ this ->customLabels );
298
- $ this ->application ->save ();
299
- if ($ this ->application ->build_pack === 'dockercompose ' ) {
300
- $ this ->loadComposeFile ();
298
+ try {
299
+ if ($ this ->application ->settings ->is_container_label_readonly_enabled ) {
300
+ return ;
301
+ }
302
+ $ this ->customLabels = str (implode ('|coolify| ' , generateLabelsApplication ($ this ->application )))->replace ('|coolify| ' , "\n" );
303
+ $ this ->ports_exposes = $ this ->application ->ports_exposes ;
304
+ $ this ->is_container_label_escape_enabled = $ this ->application ->settings ->is_container_label_escape_enabled ;
305
+ $ this ->application ->custom_labels = base64_encode ($ this ->customLabels );
306
+ $ this ->application ->save ();
307
+ if ($ this ->application ->build_pack === 'dockercompose ' ) {
308
+ $ this ->loadComposeFile ();
309
+ }
310
+ $ this ->dispatch ('configurationChanged ' );
311
+ } catch (\Throwable $ e ) {
312
+ return handleError ($ e , $ this );
301
313
}
302
- $ this ->dispatch ('configurationChanged ' );
303
314
}
304
315
305
316
public function checkFqdns ($ showToaster = true )
0 commit comments