Accessing array offset on boolean

Created on 17 October 2024, about 1 month ago

Problem/Motivation

When the module can't connect to the API, an error is thrown when throwing an exception if $result is false.

    if ($result === false || $result['status-code'] != 200) {
      throw new Exception(
        'Request to Customer Secrets API has failed: status code ' . isset($result['status-code']) ? $result['status-code'] : 'n/a'
      );
    }

Steps to reproduce

Mock an API connection failure.

Proposed resolution

Check for connection failure separately from non-200 status.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States awolfey

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024