Enhance error handling in MyTischtennisUrlController and update TrainingStatsView with TTR and QTTR columns
Improved error handling in MyTischtennisUrlController by adding detailed debug information in the response, including status codes and relevant data. Updated TrainingStatsView to display TTR and QTTR values for members, enhancing data visibility and user experience.
This commit is contained in:
@@ -419,7 +419,22 @@ class MyTischtennisUrlController {
|
||||
}
|
||||
}
|
||||
|
||||
next(error);
|
||||
const status = error.statusCode || error.status || 500;
|
||||
const debug = {
|
||||
message: error.message || String(error),
|
||||
name: error.name,
|
||||
stack: (process.env.NODE_ENV === 'dev' || process.env.NODE_ENV === 'development') ? (error.stack || null) : undefined,
|
||||
team: team ? { id: team.id, name: team.name } : null,
|
||||
league: team && team.league ? { id: team.league.id, name: team.league.name, association: team.league.association, groupId: team.league.myTischtennisGroupId, groupname: team.league.groupname } : null,
|
||||
url: typeof myTischtennisUrl !== 'undefined' ? myTischtennisUrl : null
|
||||
};
|
||||
try {
|
||||
res.status(status).json({ success: false, error: debug.message, debug });
|
||||
} catch (writeErr) {
|
||||
// Fallback, falls Headers schon gesendet wurden
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('[fetchTeamData] Response write failed:', writeErr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<span class="sort-icon">{{ getSortIcon('name') }}</span>
|
||||
</div>
|
||||
</th>
|
||||
<th>TTR</th>
|
||||
<th>QTTR</th>
|
||||
<th>Geburtsdatum</th>
|
||||
<th @click="sortBy('participation12Months')" class="sortable-header">
|
||||
<div class="header-content">
|
||||
@@ -107,6 +109,8 @@
|
||||
<tbody>
|
||||
<tr v-for="member in sortedMembers" :key="member.id" class="member-row">
|
||||
<td>{{ member.firstName }} {{ member.lastName }}</td>
|
||||
<td>{{ member.ttr ?? '–' }}</td>
|
||||
<td>{{ member.qttr ?? '–' }}</td>
|
||||
<td>{{ formatBirthdate(member.birthDate) }}</td>
|
||||
<td>{{ member.participation12Months }}</td>
|
||||
<td>{{ member.participation3Months }}</td>
|
||||
|
||||
Reference in New Issue
Block a user