@@ -26,7 +26,7 @@ export interface Wretch<Self = unknown, Chain = unknown, Resolver = undefined, E
2626 /**
2727 * @private @internal
2828 */
29- _errorTransformer ?: < T > ( error : WretchError , response : WretchResponse ) => Promise < T > | T ,
29+ _errorTransformer ?: < T > ( error : WretchError , response : WretchResponse , request : Wretch < any , any , any , any > ) => Promise < T > | T ,
3030 /**
3131 * @private @internal
3232 */
@@ -311,7 +311,7 @@ export interface Wretch<Self = unknown, Chain = unknown, Resolver = undefined, E
311311 * }
312312 *
313313 * const api = wretch("https://api.example.com")
314- * .customError<ApiError>(async (error, response) => {
314+ * .customError<ApiError>(async (error, response, request ) => {
315315 * const json = await response.json();
316316 * return { ...error, ...json };
317317 * });
@@ -326,9 +326,9 @@ export interface Wretch<Self = unknown, Chain = unknown, Resolver = undefined, E
326326 * ```
327327 *
328328 * @category Helpers
329- * @param transformer - A function that receives the error and response , and returns the transformed error with custom properties
329+ * @param transformer - A function that receives the error, response, and request , and returns the transformed error with custom properties
330330 */
331- customError < T extends ( ErrorType extends undefined ? any : ErrorType ) > ( this : Self & Wretch < Self , Chain , Resolver , ErrorType > , transformer : ( error : WretchError , response : WretchResponse ) => Promise < T > | T ) : Self & Wretch < Self , Chain , Resolver , T >
331+ customError < T extends ( ErrorType extends undefined ? any : ErrorType ) > ( this : Self & Wretch < Self , Chain , Resolver , ErrorType > , transformer : ( error : WretchError , response : WretchResponse , request : Self & Wretch < Self , Chain , Resolver , ErrorType > ) => Promise < T > | T ) : Self & Wretch < Self , Chain , Resolver , T >
332332
333333 /**
334334 * Defer one or multiple request chain methods that will get called just before the request is sent.
0 commit comments