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

Commit

Permalink
Added ServiceNotFoundException
Browse files Browse the repository at this point in the history
- When Ask/RPC calling the exception will now be ServiceNotFoundException instead of Exception
  • Loading branch information
alandoherty committed Nov 6, 2018
1 parent 55c3354 commit fa3552f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Holon/Namespace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public async Task SetupAsync() {
_replyWaits.Remove(e.ID);
}

tcs.TrySetException(new Exception("The envelope was returned before delivery"));
tcs.TrySetException(new ServiceNotFoundException("The envelope was returned before delivery"));
}
};

Expand Down
33 changes: 33 additions & 0 deletions src/Holon/Services/ServiceNotFoundException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Holon.Services
{
/// <summary>
/// Represents an exception which occurs when a service cannot be found.
/// </summary>
public class ServiceNotFoundException : Exception
{
/// <summary>
/// Creates a new service not found exception.
/// </summary>
public ServiceNotFoundException() {
}

/// <summary>
/// Creates a new service not found exception.
/// </summary>
/// <param name="message">The message.</param>
public ServiceNotFoundException(string message) : base(message) {
}

/// <summary>
/// Creates a new service not found exception.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="innerException">The inner exception.</param>
public ServiceNotFoundException(string message, Exception innerException) : base(message, innerException) {
}
}
}

0 comments on commit fa3552f

Please sign in to comment.