Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed coding_exception throws to OnlyOfficeException throws #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions classes/documentserver_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
namespace fileconverter_onlyoffice;

use coding_exception;
use curl;

defined('MOODLE_INTERNAL') || die();
Expand Down Expand Up @@ -64,13 +63,13 @@ public function request_conversion($params) {
$response = $this->curl->post($endpoint, $callargs);

if ($this->curl->errno != 0) {
throw new coding_exception($this->curl->error, $this->curl->errno);
throw new OnlyOfficeException($this->curl->error, $this->curl->errno);
}

$json = json_decode($response);

if (!empty($json->error)) {
throw new coding_exception($json->error->code . ': ' . $json->error->message . '. Response was: '.$response);
throw new OnlyOfficeException($json->error->code . ': ' . $json->error->message . '. Response was: '.$response);
}
return $json;
}
Expand Down