Skip to content

Commit

Permalink
fix: accept apiDevserverUrl with non-ok response (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjk7989 authored Aug 2, 2023
1 parent 1fff64f commit 37e69e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/msha/handlers/function.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ async function resolveLocalhostByFetching(url: string) {
.then((response) => {
if (response.ok || response.redirected) {
logger.silly(`Fetch ${Url} successfully`);
return Url;
} else {
logger.silly(`Fetch ${Url} failed with status ${response.status} ${response.statusText}`);
throw new Error(`Fetch ${Url} failed with status ${response.status} ${response.statusText}`);
logger.warn(`Fetch ${Url} with status ${response.status} ${response.statusText}`);
}
return Url;
})
.catch((err) => {
logger.silly(`Could not fetch ${Url}`);
Expand Down

0 comments on commit 37e69e1

Please sign in to comment.