diff --git a/CHANGELOG.md b/CHANGELOG.md index f03fb239f..0fea68941 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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). +## Unreleased + +### Fixed + +* 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]) + + ## Version [v0.1.15] - 2025-08-29 ### Fixed diff --git a/src/jobs/logging-legacy.jl b/src/jobs/logging-legacy.jl index b3dc98a92..c8d486d45 100644 --- a/src/jobs/logging-legacy.jl +++ b/src/jobs/logging-legacy.jl @@ -1,7 +1,10 @@ struct _LegacyLogging <: _JobLoggingAPIVersion end function JobLogMessage(::_LegacyLogging, json::Dict, offset::Integer) - message = _get_json(json, "message", String) + # 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. + message = _get_json_or(json, "message", String, "") keywords = _get_json_or(json, "keywords", Dict, Dict{String, Any}()) metadata = _get_json_or(json, "metadata", Dict, Dict{String, Any}()) timestamp = if haskey(json, "timestamp")