From 5492afe5f6959940729b1859470c1fc0b8402c36 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Wed, 10 Nov 2021 19:08:19 +0200 Subject: [PATCH] add catch to fetch --- plugins/tuna-obs/back.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tuna-obs/back.js b/plugins/tuna-obs/back.js index b7a54719..13c472a0 100644 --- a/plugins/tuna-obs/back.js +++ b/plugins/tuna-obs/back.js @@ -23,7 +23,7 @@ const post = async (data) => { 'Access-Control-Allow-Origin': '*' } const url = `http://localhost:${port}/`; - fetch(url, { method: 'POST', headers, body: JSON.stringify({ data }) }); + fetch(url, { method: 'POST', headers, body: JSON.stringify({ data }) }).catch(e => console.log(`Error: '${e.code || e.errno}' - when trying to access obs-tuna webserver at port ${port}`)); } module.exports = async () => {