-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
enhancementNew feature or requestNew feature or request
Description
We already have a flag that allows us to have errors on recordings. Most of the time we enable the flag recordFailedRequests
we still write some code to analyze if the recording has an error type we don't expect, e.g:
return setupRecording({
mutateEntry: input.options?.recordFailedRequests
? (entry) => {
if (![200, 401].includes(entry.response.status)) {
throw new Error(
`${input.name} should only receive 200 and 401 response codes - got ${entry.response.status}`,
);
}
return mutateRecordingEntry(entry);
}
We have done this across different integrations, so why don't we move it to the sdk? What we propose it to have a new field, that maybe could be used as the array in the code before.
export interface SetupRecordingInput {
directory: string;
name: string;
redactedRequestHeaders?: string[];
redactedResponseHeaders?: string[];
mutateEntry?: (entry: any) => void;
mutateRequest?: (request: any) => void;
options?: PollyConfig;
+ allowedErrorCodes?: number[];
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request