Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Readded exception constructors
Browse files Browse the repository at this point in the history
- Moved to 0.2.2
  • Loading branch information
alandoherty committed May 22, 2019
1 parent fbb79cf commit fb23903
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Holon/Holon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<Version>0.2.1</Version>
<Version>0.2.2</Version>
<Authors>Alan Doherty</Authors>
<Company>Alan Doherty</Company>
<Description>A minimal service and event bus with additional support for RPC</Description>
<Copyright>BattleCrate Ltd 2018</Copyright>
<PackageProjectUrl>https://github.com/alandoherty/holon-net</PackageProjectUrl>
<RepositoryUrl>https://github.com/alandoherty/holon-net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<PackageLicenseUrl>https://github.com/alandoherty/holon-net/blob/master/LICENSE</PackageLicenseUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://s3-eu-west-1.amazonaws.com/assets.alandoherty.co.uk/github/holon-net-nuget.png</PackageIconUrl>
<FileVersion>0.2.1.0</FileVersion>
<FileVersion>0.2.2.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 1 addition & 1 deletion src/Holon/Remoting/RpcBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public Task<InterfaceInformation> GetInterfaceInfo(string @interface) {

lock (_behaviour._behaviours) {
if (!_behaviour._behaviours.TryGetValue(@interface, out binding) || !binding.AllowIntrospection)
throw new RpcException("InterfaceNotFound", "The interface does not exist", null);
throw new RpcException("InterfaceNotFound", "The interface does not exist", (string)null);
}

return Task.FromResult(binding.Introspection);
Expand Down
27 changes: 25 additions & 2 deletions src/Holon/Remoting/RpcException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public string Code {
/// </summary>
public string Details {
get {
return _details;
return _details ?? ToString();
}
}
#endregion
Expand All @@ -41,12 +41,35 @@ public string Details {
/// <param name="code">The code.</param>
/// <param name="message">The message.</param>
/// <param name="details">The details.</param>
public RpcException(string code, string message, string details)
internal RpcException(string code, string message, string details)
: base(message) {
_code = code;
_details = details;
}

/// <summary>
/// Creates a new RPC excpetion with the provided code and message.
/// </summary>
/// <param name="code">The code.</param>
/// <param name="message">The message.</param>
public RpcException(string code, string message)
: base(message)
{
_code = code;
}

/// <summary>
/// Creates a new RPC excpetion with the provided code and message.
/// </summary>
/// <param name="code">The code.</param>
/// <param name="message">The message.</param>
/// <param name="innerException">The inner exception.</param>
public RpcException(string code, string message, Exception innerException)
: base(message, innerException)
{
_code = code;
}

/// <summary>
/// Creates a new RPC exception with the RPC error object.
/// </summary>
Expand Down

0 comments on commit fb23903

Please sign in to comment.