Skip to content

Commit 934ea0c

Browse files
el-jFabian Althaus
andauthored
fix: error return for fetcher (#125)
* fix error return for fetcher there was an lint error every time i regenerated the fetcher. this is the fix. fix: #124 * fixes template Co-authored-by: Fabian Althaus <[email protected]>
1 parent c51203d commit 934ea0c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plugins/typescript/src/templates/fetcher.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ export async function ${camel(prefix)}Fetch<
120120
return (await response.blob()) as unknown as TData;
121121
}
122122
} catch (e) {
123-
throw {
124-
status: "unknown" as const,
125-
payload:
126-
e instanceof Error
127-
? \`Network error (\${e.message})\`
128-
: "Network error"
129-
}
123+
let errorObject: Error = {
124+
name: "unknown" as const,
125+
message:
126+
e instanceof Error ? \`Network error (\${e.message})\` : "Network error",
127+
stack: e as string,
128+
};
129+
throw errorObject;
130130
}
131131
}
132132

0 commit comments

Comments
 (0)