@@ -52,9 +52,10 @@ private async Task InitializeMySqlStreamStore(CancellationToken cancellationToke
52
52
{
53
53
await streamStore . CreateSchemaIfNotExists ( cancellationToken ) ;
54
54
}
55
- catch ( MySqlException ex )
55
+ catch ( MySqlException )
56
56
{
57
- SchemaCreationFailed ( streamStore . GetSchemaCreationScript , ex ) ;
57
+ SchemaCreationFailed ( streamStore . GetSchemaCreationScript ) ;
58
+ throw ;
58
59
}
59
60
}
60
61
}
@@ -67,9 +68,10 @@ private async Task InitializeMsSqlStreamStore(CancellationToken cancellationToke
67
68
{
68
69
await streamStore . CreateSchemaIfNotExists ( cancellationToken ) ;
69
70
}
70
- catch ( SqlException ex )
71
+ catch ( SqlException )
71
72
{
72
- SchemaCreationFailed ( streamStore . GetSchemaCreationScript , ex ) ;
73
+ SchemaCreationFailed ( streamStore . GetSchemaCreationScript ) ;
74
+ throw ;
73
75
}
74
76
}
75
77
}
@@ -82,27 +84,26 @@ private async Task InitializePostgresStreamStore(CancellationToken cancellationT
82
84
{
83
85
await streamStore . CreateSchemaIfNotExists ( cancellationToken ) ;
84
86
}
85
- catch ( NpgsqlException ex )
87
+ catch ( NpgsqlException )
86
88
{
87
- SchemaCreationFailed ( streamStore . GetSchemaCreationScript , ex ) ;
89
+ SchemaCreationFailed ( streamStore . GetSchemaCreationScript ) ;
90
+ throw ;
88
91
}
89
92
}
90
93
}
91
94
92
- private static void SchemaCreationFailed ( Func < string > getSchemaCreationScript , Exception ex )
95
+ private static void SchemaCreationFailed ( Func < string > getSchemaCreationScript )
93
96
{
94
97
s_Log . Error (
95
98
new StringBuilder ( )
96
- . Append ( "Could not create schema: {ex} " )
99
+ . Append ( "Could not create schema. " )
97
100
. AppendLine ( )
98
101
. Append (
99
102
"Does your connection string have enough permissions? If not, run the following sql script as a privileged user:" )
100
103
. AppendLine ( )
101
104
. Append ( "{script}" )
102
105
. ToString ( ) ,
103
- ex ,
104
106
getSchemaCreationScript ( ) ) ;
105
- Environment . Exit ( 1 ) ;
106
107
}
107
108
}
108
109
}
0 commit comments