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

Commit fb23903

Browse files
committed
Readded exception constructors
- Moved to 0.2.2
1 parent fbb79cf commit fb23903

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

src/Holon/Holon.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard1.6</TargetFramework>
5-
<Version>0.2.1</Version>
5+
<Version>0.2.2</Version>
66
<Authors>Alan Doherty</Authors>
77
<Company>Alan Doherty</Company>
88
<Description>A minimal service and event bus with additional support for RPC</Description>
99
<Copyright>BattleCrate Ltd 2018</Copyright>
1010
<PackageProjectUrl>https://github.com/alandoherty/holon-net</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/alandoherty/holon-net</RepositoryUrl>
1212
<RepositoryType>git</RepositoryType>
13-
<AssemblyVersion>0.2.1.0</AssemblyVersion>
13+
<AssemblyVersion>0.2.2.0</AssemblyVersion>
1414
<PackageLicenseUrl>https://github.com/alandoherty/holon-net/blob/master/LICENSE</PackageLicenseUrl>
1515
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1616
<PackageIconUrl>https://s3-eu-west-1.amazonaws.com/assets.alandoherty.co.uk/github/holon-net-nuget.png</PackageIconUrl>
17-
<FileVersion>0.2.1.0</FileVersion>
17+
<FileVersion>0.2.2.0</FileVersion>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

src/Holon/Remoting/RpcBehaviour.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public Task<InterfaceInformation> GetInterfaceInfo(string @interface) {
416416

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

422422
return Task.FromResult(binding.Introspection);

src/Holon/Remoting/RpcException.cs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public string Code {
2929
/// </summary>
3030
public string Details {
3131
get {
32-
return _details;
32+
return _details ?? ToString();
3333
}
3434
}
3535
#endregion
@@ -41,12 +41,35 @@ public string Details {
4141
/// <param name="code">The code.</param>
4242
/// <param name="message">The message.</param>
4343
/// <param name="details">The details.</param>
44-
public RpcException(string code, string message, string details)
44+
internal RpcException(string code, string message, string details)
4545
: base(message) {
4646
_code = code;
4747
_details = details;
4848
}
4949

50+
/// <summary>
51+
/// Creates a new RPC excpetion with the provided code and message.
52+
/// </summary>
53+
/// <param name="code">The code.</param>
54+
/// <param name="message">The message.</param>
55+
public RpcException(string code, string message)
56+
: base(message)
57+
{
58+
_code = code;
59+
}
60+
61+
/// <summary>
62+
/// Creates a new RPC excpetion with the provided code and message.
63+
/// </summary>
64+
/// <param name="code">The code.</param>
65+
/// <param name="message">The message.</param>
66+
/// <param name="innerException">The inner exception.</param>
67+
public RpcException(string code, string message, Exception innerException)
68+
: base(message, innerException)
69+
{
70+
_code = code;
71+
}
72+
5073
/// <summary>
5174
/// Creates a new RPC exception with the RPC error object.
5275
/// </summary>

0 commit comments

Comments
 (0)