myheats

Live heats, scoring and leaderboard for sport events
git clone https://git.in0rdr.ch/myheats.git
Log | Files | Refs | Pull requests | README | LICENSE

commit b3e36f8afb19ea026609a65e890c6594b60b8dac
parent 83606fe52734bd3bf066fed145f84650c15add54
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Mon, 23 Sep 2024 07:31:44 +0200

feat: throw all errors

Diffstat:
Msrc/api/db.cjs | 36++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/api/db.cjs b/src/api/db.cjs @@ -45,7 +45,7 @@ async function invalidateToken(token) { return users } catch (error) { console.log('Error occurred in invalidateToken:', error); - throw error.errors[0] + throw error } } @@ -58,7 +58,7 @@ async function lookupToken(token) { return users } catch (error) { console.log('Error occurred in lookupToken:', error); - throw error.errors[0] + throw error } } @@ -73,7 +73,7 @@ async function saveToken(id, token, exp) { return users } catch (error) { console.log('Error occurred in saveToken:', error); - throw error.errors[0] + throw error } } @@ -94,7 +94,7 @@ async function getUser(email) { return users } catch (error) { console.log('Error occurred in getUser:', error); - throw error.errors[0] + throw error } } @@ -113,7 +113,7 @@ async function exportHeatsToCSV() { return heats } catch (error) { console.log('Error occurred in exportHeatsToCSV:', error); - throw error.errors[0] + throw error } } @@ -134,7 +134,7 @@ async function exportAthletesToCSV() { return athletes } catch (error) { console.log('Error occurred in exportAthletesToCSV:', error); - throw error.errors[0] + throw error } } @@ -146,7 +146,7 @@ async function allHeats() { return heats } catch (error) { console.log('Error occurred in allHeats:', error); - throw error.errors[0] + throw error } } @@ -159,7 +159,7 @@ async function getHeat(heatId) { return heat } catch (error) { console.log('Error occurred in getHeat:', error); - throw error.errors[0] + throw error } } @@ -171,7 +171,7 @@ async function allAthletes() { return athletes } catch (error) { console.log('Error occurred in allHeats:', error); - throw error.errors[0] + throw error } } @@ -253,7 +253,7 @@ async function removeAthlete(athleteId) { return athlete } catch (error) { console.log('Error occurred in removeAthlete:', error); - throw error.errors[0] + throw error } } @@ -274,7 +274,7 @@ async function newHeat(name, heatLocation, plannedStart) { return heat } catch (error) { console.log('Error occurred in newHeat:', error); - throw error.errors[0] + throw error } } @@ -298,7 +298,7 @@ async function distinctStartlist(heatIds) { return startlist } catch (error) { console.log('Error occurred in distinctStartlist:', error); - throw error.errors[0] + throw error } } @@ -325,7 +325,7 @@ async function startlistWithAthletes(heatId) { return startlist } catch (error) { console.log('Error occurred in startlistWithAthletes:', error); - throw error.errors[0] + throw error } } @@ -342,7 +342,7 @@ async function scoreForHeatAndAthlete(heat, athlete) { return score } catch (error) { console.log('Error occurred in scoreForHeatAndAthlete:', error); - throw error.errors[0] + throw error } } @@ -355,7 +355,7 @@ async function scoreSummaryForHeatAndAthlete(heat, athlete) { return summary } catch (error) { console.log('Error occurred in scoreSummaryForHeatAndAthlete:', error); - throw error.errors[0] + throw error } } @@ -368,7 +368,7 @@ async function getScore(heat, athlete, judge) { return scores } catch (error) { console.log('Error occurred in getScore:', error); - throw error.errors[0] + throw error } } @@ -382,7 +382,7 @@ async function setScore(heat, athlete, judge, score) { return scores } catch (error) { console.log('Error occurred in setScore:', error); - throw error.errors[0] + throw error } } @@ -402,7 +402,7 @@ async function getScores() { ) } catch (error) { console.log('Error occurred in getScores:', error); - throw error.errors[0] + throw error } }