Skip to content

Commit

Permalink
Improve error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Jun 23, 2022
1 parent da5ba2d commit 14b9ea0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
2 changes: 1 addition & 1 deletion cli/Squidex.CLI/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Squidex/squidex/</PackageProjectUrl>
<PackageTags>Squidex HeadlessCMS</PackageTags>
<Version>8.18</Version>
<Version>8.19</Version>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -127,35 +127,29 @@ public static void HandleException(Exception ex, Action<string> error)
{
switch (ex)
{
case SquidexManagementException<ErrorDto> ex1:
{
error(ex1.Result.ToString());
break;
}

case SquidexManagementException ex2:
{
error(ex2.Message);
break;
}

case CLIException ex4:
{
error(ex4.Message);
break;
}

case FileNotFoundException ex5:
{
error(ex5.Message);
break;
}

case { } ex3:
{
error(ex3.ToString());
throw ex3;
}
case SquidexManagementException<ErrorDto> typed:
error(typed.Result.ToString());
break;

case SquidexManagementException typed:
error(typed.Message);
break;

case CLIException typed:
error(typed.Message);
break;

case IOException typed:
error(typed.Message);
break;

case OperationCanceledException typed:
error(typed.Message);
break;

case { } fallback:
error(fallback.ToString());
break;
}
}
}
Expand Down

0 comments on commit 14b9ea0

Please sign in to comment.