Skip to content

Commit

Permalink
Revert error
Browse files Browse the repository at this point in the history
  • Loading branch information
emmerich committed Apr 4, 2024
1 parent 1d784df commit 47a7b03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/react-openapi/src/fetchOpenAPIOperation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ it('should resolve a ref with whitespace', async () => {
},
},
});
});
});
10 changes: 2 additions & 8 deletions src/lib/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ export async function fetchOpenAPIBlock(
return { error };
}

return {
error: new OpenAPIFetchError(
`Failed to fetch OpenAPI block: ${error instanceof Error ? error.message : typeof error}`,
resolved.href,
),
};
throw error;
}
}

Expand All @@ -64,9 +59,8 @@ const fetcher: OpenAPIFetcher = {
});

if (!response.ok) {
throw new OpenAPIFetchError(
throw new Error(
`Failed to fetch OpenAPI file: ${response.status} ${response.statusText}`,
url,
);
}

Expand Down

0 comments on commit 47a7b03

Please sign in to comment.