git.cweiske.de
/
tt-rss-micropub.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Show micropub error descriptions
[tt-rss-micropub.git]
/
init.php
diff --git
a/init.php
b/init.php
index 745d432424a246172747c2af63687408f268b4b1..d561aa5421b561d2fe81269786625afdfb2bcf24 100644
(file)
--- 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) {
$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(
return $this->errorOut(
- '
An error occured
: '
- . $code . ' ' . $text
+ '
Error creating post
: '
+ . $code . ' ' . $text
.$content
);
}
);
}