Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/NexusRpc/Handlers/HandlerErrorType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ public enum HandlerErrorType
/// </summary>
NotFound,

/// <summary>
/// Returned by the server to when it has given up handling a request. The may occur by enforcing a client
/// provided `Request-Timeout` or for any arbitrary reason such as enforcing some configurable limit. Subsequent
/// requests by the client are permissible.
/// </summary>
RequestTimeout,

/// <summary>
/// The request could not be made due to a conflict. The may happen when trying to create an operation that
/// has already been started. Clients should not retry this request unless advised otherwise.
/// </summary>
Conflict,

/// <summary>
/// Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file
/// system is out of space. Subsequent requests by the client are permissible.
Expand Down
3 changes: 3 additions & 0 deletions src/NexusRpc/Handlers/HandlerException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class HandlerException : Exception
["UNAUTHENTICATED"] = HandlerErrorType.Unauthenticated,
["UNAUTHORIZED"] = HandlerErrorType.Unauthorized,
["NOT_FOUND"] = HandlerErrorType.NotFound,
["REQUEST_TIMEOUT"] = HandlerErrorType.RequestTimeout,
["CONFLICT"] = HandlerErrorType.Conflict,
["RESOURCE_EXHAUSTED"] = HandlerErrorType.ResourceExhausted,
["INTERNAL"] = HandlerErrorType.Internal,
["NOT_IMPLEMENTED"] = HandlerErrorType.NotImplemented,
Expand All @@ -32,6 +34,7 @@ public class HandlerException : Exception
HandlerErrorType.Unauthenticated,
HandlerErrorType.Unauthorized,
HandlerErrorType.NotFound,
HandlerErrorType.Conflict,
HandlerErrorType.NotImplemented,
};

Expand Down