oci-dotnet-sdk icon indicating copy to clipboard operation
oci-dotnet-sdk copied to clipboard

JsonReaderException: not being able to see the response

Open ZackStone opened this issue 1 month ago • 2 comments

Oracle's response is not a JSON, and I'm not able to see its content. There should be a better way to handle this case.

Error: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Oci.Common.Http.Internal.ResponseHelper.HandleNonSuccessfulResponse(HttpResponseMessage responseMessage, ApiDetails apiDetails, String caller)
   at Oci.Common.Retry.GenericRetrier.ShoulRetryOnHttpResponse(HttpResponseMessage response)
   at Oci.Common.Retry.GenericRetrier.<>c__DisplayClass4_0.<MakeRetryingCall>b__1(HttpResponseMessage r)
   at Polly.PolicyBuilder`1.<>c__DisplayClass14_0.<OrResult>b__0(TResult result)
   at Polly.ResultPredicates`1.<>c__DisplayClass2_0.<AnyMatch>b__0(ResultPredicate`1 predicate)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Polly.ResultPredicates`1.AnyMatch(TResult result)
   at Polly.Retry.AsyncRetryEngine.<ImplementationAsync>d__0`1.MoveNext()

https://github.com/oracle/oci-dotnet-sdk/blob/a4442019154a208f8c5b7092f52be5502eda9b3b/Common/Src/Http/Internal/ResponseHelper.cs#L113-L120

ZackStone avatar Nov 07 '25 22:11 ZackStone

Possibly related: #298

ZackStone avatar Nov 07 '25 22:11 ZackStone

@NiviPari - Can you take a look ?

jyotisaini avatar Nov 07 '25 22:11 jyotisaini