Skip to content

Commit

Permalink
Add base class for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddix committed Oct 25, 2022
1 parent c711dc4 commit d066f52
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 deletions.
17 changes: 17 additions & 0 deletions src/MccSoft.IntegreSql.EF/Exceptions/IntegreSqlException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Runtime.Serialization;

namespace MccSoft.IntegreSql.EF.Exceptions;

public class IntegreSqlException : Exception
{
public IntegreSqlException() { }

protected IntegreSqlException(SerializationInfo info, StreamingContext context)
: base(info, context) { }

public IntegreSqlException(string message) : base(message) { }

public IntegreSqlException(string message, Exception innerException)
: base(message, innerException) { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MccSoft.IntegreSql.EF.Exceptions;

public class IntegreSqlInternalServerErrorException : Exception
public class IntegreSqlInternalServerErrorException : IntegreSqlException
{
public IntegreSqlInternalServerErrorException(string content, Exception innerException = null)
: base(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MccSoft.IntegreSql.EF.Exceptions;

public class IntegreSqlNotRunningException : Exception
public class IntegreSqlNotRunningException : IntegreSqlException
{
public IntegreSqlNotRunningException(string uri, Exception innerException = null)
: base(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace MccSoft.IntegreSql.EF.Exceptions;

public class IntegreSqlPostgresNotAvailableException : Exception
public class IntegreSqlPostgresNotAvailableException : IntegreSqlException
{
public IntegreSqlPostgresNotAvailableException(string uri)
: base(
$"IntegreSQL at '{uri}' can't connect to PostgreSQL. Examine IntegreSQL docker logs and make sure you set up IntegreSQL and PostgreSQL corectly."
+ $"Maybe running docker-compose from https://github.com/mcctomsk/IntegreSql.EF/tree/main/scripts could help."
+ $"Maybe running docker-compose from https://github.com/mcctomsk/IntegreSql.EF/tree/main/scripts could help."
) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace MccSoft.IntegreSql.EF.Exceptions;

public class IntegreSqlTemplateDiscardedException : Exception
public class IntegreSqlTemplateDiscardedException : IntegreSqlException
{
public IntegreSqlTemplateDiscardedException(string templateHash)
: base($"Template with hash '{templateHash}' was discarded.") { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MccSoft.IntegreSql.EF.Exceptions;

public class IntegreSqlTemplateNotFoundException : Exception
public class IntegreSqlTemplateNotFoundException : IntegreSqlException
{
public IntegreSqlTemplateNotFoundException(string templateHash)
: base(
Expand Down
2 changes: 1 addition & 1 deletion src/MccSoft.IntegreSql.EF/MccSoft.IntegreSql.EF.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>0.8.11</Version>
<Version>0.8.12</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>MCC Soft</Authors>
<Description>OpenIddict extension to support Auth code flow fo built-in ASP.Net identity providers</Description>
Expand Down

0 comments on commit d066f52

Please sign in to comment.