OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.97k stars 950 forks source link

Wrap the original exception in ServiceResultException-s thrown from JsonDecoder #2835

Open ZbynekZ opened 2 weeks ago

ZbynekZ commented 2 weeks ago

Type of issue

Current Behavior

When JsonDecoder throws ServiceResultException as a result of some inner exception such as FormatException, JsonReaderException or XmlException, it now includes the error message of the inner exception, but not the inner exception object as such. This makes it impossible to do advanced diagnostics or fine-handle the error in the code that uses JsonDecoder.

In principle this also applies to BinaryDecoder/XmlDecoder, and to the encoders, but at this point for my usage the JsonDecoder is the one that needs this most, for PubSub interoperability troubleshooting efforts.

Expected Behavior

A ServiceResultException constructor or ServiceResultException.Create method with the "innerException" parameter should be used instead, and the original exception passed in.

Steps To Reproduce

No response

Environment

- OS:
- Environment:
- Runtime:
- Nuget Version: 1.5.374.126
- Component:
- Server:
- Client:

Anything else?

No response