Skip to content

Commit 5fa0791

Browse files
Return raw when an error in fetch is detected
1 parent d0e434c commit 5fa0791

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unified-api",
3-
"version": "1.0.26",
3+
"version": "1.0.27",
44
"description": "Easily create and call APIs in Typescript",
55
"author": "Decatur Robotics",
66
"license": "MIT",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class RequestHelper {
155155

156156
async function getRes(raw: Response | { error: any }) {
157157
if ("error" in raw) {
158-
return raw.error;
158+
return raw;
159159
}
160160

161161
const text = await raw.text();

0 commit comments

Comments
 (0)