We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 949b8d2 commit 88e09ccCopy full SHA for 88e09cc
1 file changed
plugins/typescript/src/templates/fetcher.ts
@@ -109,11 +109,8 @@ export async function ${camel(prefix)}Fetch<
109
: "Unexpected error"
110
};
111
}
112
-
113
- throw error;
114
115
116
- if (response.headers.get('content-type')?.includes('json')) {
+ else if (response.headers.get('content-type')?.includes('json')) {
117
return await response.json();
118
} else {
119
// if it is not a json response, assume it is a blob and cast it to TData
@@ -128,6 +125,7 @@ export async function ${camel(prefix)}Fetch<
128
125
129
126
throw errorObject;
130
127
+ throw error;
131
132
133
const resolveUrl = (
0 commit comments