X-Git-Url: https://git.cweiske.de/tt-rss-micropub.git/blobdiff_plain/91b3819720f7492585d099a7d596f082d1fad1ae..942fe99fa36c2f18397ee5de5f64a4aff932dda0:/init.php?ds=sidebyside diff --git a/init.php b/init.php index 745d432..d561aa5 100644 --- a/init.php +++ b/init.php @@ -272,9 +272,18 @@ class Micropub extends Plugin implements IHandler $status = array_shift($headers); list($httpver, $code, $text) = explode(' ', $status, 3); if ($code != 201 && $code != 202) { + $errData = json_decode($content); + if (isset($errData->error_description) + && $errData->error_description != '' + ) { + return $this->errorOut( + 'Error creating post: ' + . $errData->error_description + ); + } return $this->errorOut( - 'An error occured: ' - . $code . ' ' . $text + 'Error creating post: ' + . $code . ' ' . $text.$content ); }