Add a ProxyRequestException.ParseCustomErrorResult() method#375
Open
mlaily wants to merge 1 commit intoZaid-Ajaj:masterfrom
Open
Add a ProxyRequestException.ParseCustomErrorResult() method#375mlaily wants to merge 1 commit intoZaid-Ajaj:masterfrom
mlaily wants to merge 1 commit intoZaid-Ajaj:masterfrom
Conversation
So clients can more easily retrieve the serialized propagated exceptions sent by the server.
e96dd57 to
2c77f1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
I was a bit surprised by the lack of built-int support for handling
Propagatedcustom errors/exceptions.It wouldn't be so bad if the propagated serialized object was the one given by the user on the server side, but it's instead wrapped inside a custom
CustomErrorResult<'a>type defined on the server side, and inaccessible from the client without redefining a type with the same shape.This makes handling exceptions on the client side harder than it has to be.
I see this topic has been discussed here #261 but not resolved.
I'd like to propose a few changes in this PR:
CustomErrorResult<'a>type readily available on the client side.ParseCustomErrorResult<'userError>()method on theProxyRequestExceptiontype.With these changes, it should be easier to handle custom exceptions from the client side, without having to manually parse json that is not under the control of the user.
Let me know what you think!
Remark: I don't know how to run the Azure tests, so I did my best but they might be failing if I made a mistake somewhere...