Skip to content

Commit

Permalink
Added unit test with 304 response
Browse files Browse the repository at this point in the history
  • Loading branch information
Haimantika Mitra authored and Haimantika Mitra committed Apr 9, 2024
1 parent 9094eaf commit 0b189fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nethttp_request_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ const ErrorBodyFoundAttributeName = "com.microsoft.kiota.error.body_found"
func (a *NetHttpRequestAdapter) throwIfFailedResponse(ctx context.Context, response *nethttp.Response, errorMappings abs.ErrorMappings, spanForAttributes trace.Span) error {
ctx, span := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "throwIfFailedResponse")
defer span.End()
if response.StatusCode < 400 {
if response.StatusCode < 400 || response.StatusCode == http.StatusNotModified {

Check failure on line 746 in nethttp_request_adapter.go

View workflow job for this annotation

GitHub Actions / build

undefined: http
return nil
}
spanForAttributes.SetStatus(codes.Error, "received_error_response")
Expand Down

0 comments on commit 0b189fb

Please sign in to comment.