Skip to content

Set response headers on ServiceException thrown on service response #193

@MIchaelMainer

Description

@MIchaelMainer

This way customers have access to correlation ids for all ServiceExceptions caused by the service.

Message = ErrorConstants.Messages.LocationHeaderNotSetOnRedirect,

In this example, ServiceException thrown when there is no Location header for a redirect is an issue as we don't capture the requestId from the response headers.

Expected

throw new ServiceException(
	new Error
	{
		Code = ErrorConstants.Codes.GeneralException,
		Message = ErrorConstants.Messages.LocationHeaderNotSetOnRedirect,
	}, 
	response.ResponseHeaders,
	response.StatusCode
);

Actual

                throw new ServiceException(
                    new Error
                    {
                        Code = ErrorConstants.Codes.GeneralException,
                        Message = ErrorConstants.Messages.LocationHeaderNotSetOnRedirect,
                    });

AB#7191

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions