fix: error message

This commit is contained in:
peaklabs-dev
2024-12-23 17:58:56 +01:00
parent 0a851ec3f2
commit 6dc87498de

View File

@@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB;
class UpdateEmailEncryptionValues extends Migration class UpdateEmailEncryptionValues extends Migration
{ {
/** /**
* The encryption mappings. * Encryption mappings.
*/ */
private array $encryptionMappings = [ private array $encryptionMappings = [
'tls' => 'starttls', 'tls' => 'starttls',
@@ -33,10 +33,7 @@ class UpdateEmailEncryptionValues extends Migration
]); ]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
\Log::error('Failed to update instance_settings encryption for ID: '.$setting->id, [ \Log::error('Failed to update instance settings: '.$e->getMessage());
'error' => $e->getMessage(),
'old_value' => $setting->smtp_encryption,
]);
} }
} }
@@ -51,19 +48,14 @@ class UpdateEmailEncryptionValues extends Migration
]); ]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
\Log::error('Failed to update email_notification_settings encryption for ID: '.$setting->id, [ \Log::error('Failed to update email settings: '.$e->getMessage());
'error' => $e->getMessage(),
'old_value' => $setting->smtp_encryption,
]);
} }
} }
DB::commit(); DB::commit();
} catch (\Exception $e) { } catch (\Exception $e) {
DB::rollBack(); DB::rollBack();
\Log::error('Failed to complete email encryption migration', [ \Log::error('Failed to update email encryption: '.$e->getMessage());
'error' => $e->getMessage(),
]);
throw $e; throw $e;
} }
} }
@@ -93,10 +85,7 @@ class UpdateEmailEncryptionValues extends Migration
]); ]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
\Log::error('Failed to reverse instance_settings encryption for ID: '.$setting->id, [ \Log::error('Failed to reverse instance settings: '.$e->getMessage());
'error' => $e->getMessage(),
'old_value' => $setting->smtp_encryption,
]);
} }
} }
@@ -111,19 +100,14 @@ class UpdateEmailEncryptionValues extends Migration
]); ]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
\Log::error('Failed to reverse email_notification_settings encryption for ID: '.$setting->id, [ \Log::error('Failed to reverse email settings: '.$e->getMessage());
'error' => $e->getMessage(),
'old_value' => $setting->smtp_encryption,
]);
} }
} }
DB::commit(); DB::commit();
} catch (\Exception $e) { } catch (\Exception $e) {
DB::rollBack(); DB::rollBack();
\Log::error('Failed to complete email encryption rollback migration', [ \Log::error('Failed to reverse email encryption: '.$e->getMessage());
'error' => $e->getMessage(),
]);
throw $e; throw $e;
} }
} }