Skip to content

Commit

Permalink
fix put response
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardo-devis-agullo committed Sep 24, 2024
1 parent ee6f1dd commit 8334df0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cli/domain/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function registry(opts: RegistryOptions = {}) {
try {
await put(options.route, options.path, requestsHeaders);
} catch (err) {
let parsedError = (err as any).response.body || (err as any);
let parsedError = err as any;
let errMsg = '';
if (!parsedError || typeof parsedError !== 'object') {
try {
Expand Down
5 changes: 3 additions & 2 deletions src/utils/put.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ async function put(
body: form
});

const response = await res.body.text();
if (res.statusCode !== 200) {
throw res.body.text();
throw response;
}

return res.body.text();
return response;
}

export default put;

0 comments on commit 8334df0

Please sign in to comment.