From 693ac2c87992876a6ce731133cabd6249b95a7e3 Mon Sep 17 00:00:00 2001 From: Christoph Rumpel Date: Wed, 9 Aug 2023 09:02:32 +0200 Subject: [PATCH] do not throw exception for 201 response code --- app/Services/Twitter/OAuthTwitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Twitter/OAuthTwitter.php b/app/Services/Twitter/OAuthTwitter.php index de1685e..25c5a6e 100644 --- a/app/Services/Twitter/OAuthTwitter.php +++ b/app/Services/Twitter/OAuthTwitter.php @@ -15,7 +15,7 @@ public function tweet(string $text): ?array { $response = $this->twitter->post('tweets', compact('text'), true); - if ($this->twitter->getLastHttpCode() > 200) { + if ($this->twitter->getLastHttpCode() > 201) { throw TwitterException::general($this->twitter->getLastHttpCode(), json_encode($response) ?? $response->title); }