Fix some errors

parent 635296f1
...@@ -84,7 +84,7 @@ abstract class TyposClientInterface ...@@ -84,7 +84,7 @@ abstract class TyposClientInterface
* @param mixed $message Some data to send to the requesting server * @param mixed $message Some data to send to the requesting server
* @return array Success response * @return array Success response
*/ */
private function getSuccessMessage(mixed $message) { private function getSuccessMessage($message) {
return [ return [
"errorCode" => 200, "errorCode" => 200,
"message" => $message "message" => $message
...@@ -115,11 +115,12 @@ abstract class TyposClientInterface ...@@ -115,11 +115,12 @@ abstract class TyposClientInterface
try { try {
// May throw InvalidArgumentException // May throw InvalidArgumentException
$id = $this->getArticleIdFromLink($link); $id = $this->getArticleIdFromLink($link);
// May throw Exception (if article has not been found) // May throw Exception (if article has not been found)
return $this->getSuccessMessage($this->getArticleEditLink($id)); return $this->getSuccessMessage($this->getArticleEditLink($id));
} catch (\Exception $e) { } catch (\Exception $e) {
error_log(`[TyposClientInterface] [getEditLink] Failed to get edit link: {$e->getMessage()}`); error_log(`[TyposClientInterface] [getEditLink] Failed to get edit link: {$e->getMessage()}`);
return $this->getErrorMessage(500, "Failed to get an edit link"); return $this->getErrorMessage(500, "Failed to get an edit link: {$e->getMessage()}");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment