Skip to content

Commit ea21f34

Browse files
authored
fix: Invalid variable access inside fetcher (#277)
1 parent e364320 commit ea21f34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/typescript/src/templates/fetcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export async function ${camel(prefix)}Fetch<
7272
TQueryParams,
7373
TPathParams
7474
>): Promise<TData> {
75+
let error: ErrorWrapper<TError>;
7576
try {
7677
const requestHeaders: HeadersInit = {
7778
"Content-Type": "application/json",
@@ -97,7 +98,6 @@ export async function ${camel(prefix)}Fetch<
9798
}
9899
);
99100
if (!response.ok) {
100-
let error: ErrorWrapper<TError>;
101101
try {
102102
error = await response.json();
103103
} catch (e) {

0 commit comments

Comments
 (0)