Skip to content

Commit a679c4b

Browse files
committed
CHANGES:
- Better error messages on report errors.
1 parent f44c2e6 commit a679c4b

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ DCSServerBot supports a lot of them already which can add some quality of life.
150150
You need the following software to run DCSServerBot:
151151

152152
#### a) Python
153-
You need to have [Python](https://www.python.org/downloads/) 3.10 or higher installed.
153+
You need to have [Python](https://www.python.org/downloads/) 3.11 or higher installed.
154154
Please make sure that you tick "Add python.exe to PATH" during your Python installation.
155155

156156
> [!WARNING]
157-
> Pythong 3.14 is still very new and many third-party libraries are either not yet or not fully supported yet.
158-
> The bot should install with 3.14 though, but you can not expect the same performance as with 3.13 yet.
159-
> That said - use 3.14 on your own risk.
157+
> Python 3.14 is still very new, and many third-party libraries are either not or not fully supported yet.
158+
> The bot should install with 3.14, though, but you cannot expect the same performance as with 3.13 yet.
159+
> That said use 3.14 at your own risk.
160160
161161
#### b) PostgreSQL
162162
DCSServerBot needs a database to store information in. I decided to use [PostgreSQL](https://www.postgresql.org/download/), as it has great performance

core/report/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(self, bot: DCSServerBot, plugin: str, filename: str):
4242
self.apool = bot.apool
4343
self.env = ReportEnv(bot)
4444
self.filename, self.report_def = self.load_report_def(plugin, filename)
45+
self.env.report = self.filename
4546

4647
def load_report_def(self, plugin: str, filename: str):
4748
default = f'./plugins/{plugin}/reports/{filename}'

core/report/elements.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ async def render(self, **kwargs):
327327
for result in results:
328328
if isinstance(result, Exception):
329329
if not isinstance(result, NothingToPlot):
330-
self.log.error("Error in Graph:\n{stacktrace}".format(
331-
stacktrace=''.join(traceback.format_exception(result)))
330+
self.log.error("{filename}: Error in Graph\n{stacktrace}".format(
331+
filename=self.env.report, stacktrace=''.join(traceback.format_exception(result)))
332332
)
333333

334334
# only render the graph if we don't have a rendered graph already attached as a file (image)

core/report/env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ class ReportEnv:
2222
buffer: BytesIO = None
2323
params: dict = None
2424
mention: str = None
25+
report: str = None

extensions/lotatc/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ MyNode:
2626
LotAtc:
2727
autoupdate: true # auto update LotAtc in this instance, if a new version is available (default: false)
2828
show_passwords: false # show passwords in the server status embed (default = true)
29-
host: "myfancyhost.com" # Show a different hostname instead of your servers external IP
30-
port: 10310 # you can specify any parameter from LotAtc's config.lua in here to overwrite it
29+
host: "myfancyhost.com" # Optional: Show a different hostname instead of your servers external IP
30+
port: 10310 # Optional: your LotAtc port (default: 10310)
31+
jsonserver_port: 8081 # Optional: you can specify any parameter from LotAtc's config.lua in here to overwrite it
32+
# ...
3133
```
3234

3335
> [!TIP]

plugins/userstats/highscore.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ class HighscoreElement(report.GraphElement):
103103

104104
async def render(self, interaction: discord.Interaction, server_name: str, limit: int, kill_type: str,
105105
flt: StatisticsFilter, bar_labels: bool | None = True):
106+
107+
if flt is None:
108+
raise ValueError('Wrong period provided!')
109+
106110
sql_parts = {
107111
'Air Targets': 'SUM(s.kills_planes+s.kills_helicopters)',
108112
'Ships': 'SUM(s.kills_ships)',

0 commit comments

Comments
 (0)