Skip to content

Commit fa5b00d

Browse files
committed
set success on status between 200 and 206
1 parent e561197 commit fa5b00d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lambda/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ const handler: Handler = async (payload: Payload) => {
1818
headers: headers,
1919
});
2020

21-
if (response.status === 200 || response.status === 202) {
22-
console.log(`Alert sent to API successfully with status ${response.status}`);
21+
if (response.status >= 200 && response.status <= 206) {
22+
console.log(`Resquest sent to API successfully with status ${response.status}`);
2323
} else {
24-
console.error(`Failed to send alert to API. Status code: ${response.status}, Response: ${response.data}`);
24+
console.error(`Failed to send resquest to API. Status code: ${response.status}, Response: ${response.data}`);
2525
}
2626
} catch (error) {
27-
console.error('Error sending alert to API:', error.message);
27+
console.error('Error sending resquest to API:', error.message);
2828
}
2929

3030

0 commit comments

Comments
 (0)