Skip to content

Commit

Permalink
fix exception handling in Program.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ieremenko committed Oct 6, 2018
1 parent 566f2c1 commit 61568dd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Sources/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.0")]
24 changes: 14 additions & 10 deletions Sources/SqlDatabase/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ public static int Main(string[] args)

internal static bool ExecuteCommand(CommandLine cmd)
{
if (cmd.Command == Command.Upgrade)
{
return DoUpgrade(cmd);
}

if (cmd.Command == Command.Create)
try
{
return DoCreate(cmd);
switch (cmd.Command)
{
case Command.Upgrade:
return DoUpgrade(cmd);
case Command.Create:
return DoCreate(cmd);
case Command.Execute:
return DoExecute(cmd);
}
}

if (cmd.Command == Command.Execute)
catch (Exception ex)
{
return DoExecute(cmd);
Logger.Error(ex.Message);
Logger.Info(ex.ToString());
return false;
}

throw new NotImplementedException();
Expand Down
8 changes: 8 additions & 0 deletions Sources/SqlDatabase/SqlDatabase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@
<AssemblyOriginatorKeyFile>..\SqlDatabase.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<None Remove="Configuration\CommandLine.txt" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\GlobalAssemblyInfo.cs" Link="Properties\GlobalAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Configuration\CommandLine.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit 61568dd

Please sign in to comment.