From bc5511fe528f1353e36aeacefb45974940d0bd54 Mon Sep 17 00:00:00 2001 From: ste87 Date: Sat, 14 Mar 2026 15:19:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Speed/Convoy.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Speed/Convoy.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Speed/Convoy.php b/Speed/Convoy.php index 4143e98..70f95f4 100644 --- a/Speed/Convoy.php +++ b/Speed/Convoy.php @@ -13,7 +13,7 @@ class Convoy extends Server { public function request($url, $method = 'get', $data = []): array { - // Trim any leading slashes from the base url and add the path URL to it + // Trim any leading slashes from the base url and add the path url to it $req_url = rtrim($this->config('host'), '/') . '/api/application/' . $url; $response = Http::withHeaders([ 'Authorization' => 'Bearer ' . $this->config('api_key'), @@ -22,11 +22,7 @@ class Convoy extends Server if (!$response->successful()) { $json = $response->json(); - if (is_array($json)) { - $message = $json['message'] ?? $json['error'] ?? $json['errors'][0]['message'] ?? 'Server Error'; - } else { - $message = 'Server Error: ' . $response->status(); - } + $message = $json['message'] ?? $json['error'] ?? 'Server Error'; throw new Exception($message); } @@ -193,8 +189,6 @@ class Convoy extends Server } catch (Exception $e) { return $e->getMessage(); } - - return true; } // Convoy is really strict (The account password must contain 8 - 50 characters, 1 uppercase, 1 lowercase, 1 number and 1 special character.)