Skip to content

FabricException ErrorCode changed to Unknown when thrown via Remoting #208

@0shi

Description

@0shi

Describe the bug
A FabricException thrown from user code and returned to another service via Remoting has an ErrorCode property of Unknown when observed at the calling service, regardless of its original ErrorCode.
The HResult appears unchanged, as a workaround we will check the HResult as well as the ErrorCode.

To Reproduce
Source of exception - A Service that will be interacted with via SF Remoting

public async Task DoStuff()   
{   
   var ex = new FabricException(FabricErrorCode.OperationTimedOut);
   throw ex;
}

Reader of exception - A service with a Polly for retrying transient exceptions:

await policy.ExecuteAsync(async () =>   
{   
   // Assume we already have a proxy
   await proxy.DoStuff().ConfigureAwait(false);
}

Expected behavior
ErrorCode is the same at the source and the caller.

Additional context
Observed while developing a retry wrapper around SF Remoting operations for transient SF exceptions and intentionally throwing a FabricException from user code to test the wrapper. Unsure if the same behaviour would be present if the FabricException had originated in the SF internals.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions