Replace throwing error with console.warn() when no train data in response

This commit is contained in:
2023-08-15 12:12:21 +01:00
parent 4a9089fbdc
commit 63d2508423
2 changed files with 3 additions and 3 deletions

View File

@ -189,7 +189,7 @@ export default {
const getTrainData = httpsCallable(functions, 'getLiveTrainData'); const getTrainData = httpsCallable(functions, 'getLiveTrainData');
getTrainData().then((response) => { getTrainData().then((response) => {
try { try {
if (!response.data) throw new Error("Error fetching live train data from the database") if (!response.data) console.warn("No train data in response!");
var unorderedTrains = []; var unorderedTrains = [];
var insights = { var insights = {
"totalNumTrains": 0, "totalNumTrains": 0,

View File

@ -415,7 +415,7 @@ export default {
const getTrainData = httpsCallable(functions, 'getLiveTrainData'); const getTrainData = httpsCallable(functions, 'getLiveTrainData');
getTrainData().then((response) => { getTrainData().then((response) => {
try { try {
if (!response.data) throw new Error("Error fetching live train data from the database") if (!response.data) console.warn("No train data in response!");
var unorderedTrains = []; var unorderedTrains = [];
var currentMessages = []; var currentMessages = [];
var insights = { var insights = {