Skip to content

Commit a585605

Browse files
committed
TMS-1183: Use Logger for EventzClient errors
1 parent b5bfde0 commit a585605

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
- TMS-1183: Use Logger for EventzClient errors
11+
1012
## [1.62.0] - 2025-06-23
1113

1214
- TMS-1172: Add video possibility to hero-museum layout

lib/EventzClient.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,12 @@ public function do_get_request( string $api_url = '' ) {
316316
$status_code = $payload->status_code;
317317

318318
if ( ! in_array( $status_code, [ 200, 201 ], true ) ) {
319-
throw new EventzException(
319+
( new Logger() )->error(
320320
sprintf( '%s: %s', $api_url, $payload->body ?? 'Unknown error' ),
321-
$status_code
321+
[ 'status_code' => $status_code ]
322322
);
323+
324+
return false;
323325
}
324326

325327
return $payload->body ?? '';

0 commit comments

Comments
 (0)