Skip to content

Commit 9d828d6

Browse files
authored
fix: handle nonexistent message attribute in logs (#111)
The .message property _should_ always be present in the log messages, but there are a few versions out there where it's sometimes omitted due to a backend bug. So we default to an empty string in those cases.
1 parent 5ced9c0 commit 9d828d6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## Unreleased
6+
7+
### Fixed
8+
9+
* The `.message` property _should_ always be present in the log messages, but there are a few versions out there where it is sometimes omitted due to a backend bug. We default to an empty string in those cases. ([#111])
10+
11+
512
## Version [v0.1.15] - 2025-08-29
613

714
### Fixed

src/jobs/logging-legacy.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
struct _LegacyLogging <: _JobLoggingAPIVersion end
22

33
function JobLogMessage(::_LegacyLogging, json::Dict, offset::Integer)
4-
message = _get_json(json, "message", String)
4+
# The .message property _should_ always be present in the log messages,
5+
# but there are a few versions out there where it's sometimes omitted due
6+
# to a backend bug. So we default to an empty string in those cases.
7+
message = _get_json_or(json, "message", String, "")
58
keywords = _get_json_or(json, "keywords", Dict, Dict{String, Any}())
69
metadata = _get_json_or(json, "metadata", Dict, Dict{String, Any}())
710
timestamp = if haskey(json, "timestamp")

0 commit comments

Comments
 (0)