Skip to content

Commit 5088408

Browse files
committed
fix: Wrong output message
1 parent 9554954 commit 5088408

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/repositories/remote-repository.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const insert = async (target, body) => {
4343
status_code: result.status,
4444
message: await getMessageOr(
4545
result,
46-
`Something wrong happen. Item: '${uuid}`
46+
`Something wrong happen. Item: '${target}`
4747
),
4848
};
4949
};
@@ -227,6 +227,9 @@ const getMessageOr = async (response, fallback) => {
227227
try {
228228
message = await response.json();
229229
} catch (err) {
230+
// Handle 2XX without body
231+
if (response.ok) return null;
232+
230233
error(err);
231234
message = fallback;
232235
}

0 commit comments

Comments
 (0)