mirror of
https://github.com/LukeHagar/crossws.git
synced 2025-12-10 04:19:37 +00:00
attempting to resolve type issues
This commit is contained in:
@@ -66,11 +66,14 @@ export class AdapterHookable {
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
const errResponse = (error as { response: Response }).response || error;
|
||||
if (errResponse instanceof Response) {
|
||||
if (
|
||||
error instanceof Response ||
|
||||
(error && typeof error === "object" && "response" in error && typeof error.response === "function")
|
||||
) {
|
||||
const response = error instanceof Response ? error : (error as { response: () => Response }).response();
|
||||
return {
|
||||
context,
|
||||
endResponse: errResponse,
|
||||
endResponse: response,
|
||||
};
|
||||
}
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user