summaryrefslogtreecommitdiff
path: root/modules/rest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest')
-rw-r--r--modules/rest/helpers/rest_installer.php4
-rw-r--r--modules/rest/views/error_rest.json.php4
2 files changed, 7 insertions, 1 deletions
diff --git a/modules/rest/helpers/rest_installer.php b/modules/rest/helpers/rest_installer.php
index c2694a29..3c7fea4b 100644
--- a/modules/rest/helpers/rest_installer.php
+++ b/modules/rest/helpers/rest_installer.php
@@ -35,7 +35,9 @@ class rest_installer {
static function upgrade($version) {
$db = Database::instance();
if ($version == 1) {
- $db->query("RENAME TABLE {user_access_tokens} TO {user_access_keys}");
+ if (in_array("user_access_tokens", Database::instance()->list_tables())) {
+ $db->query("RENAME TABLE {user_access_tokens} TO {user_access_keys}");
+ }
module::set_version("rest", $version = 2);
}
diff --git a/modules/rest/views/error_rest.json.php b/modules/rest/views/error_rest.json.php
index 179ce7f9..8c99ef45 100644
--- a/modules/rest/views/error_rest.json.php
+++ b/modules/rest/views/error_rest.json.php
@@ -1,2 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
+<?
+// Log error response to ease debugging
+Kohana_Log::add("error", "Rest error details: " . print_r($e->response, 1));
+?>
<?= json_encode($e->response); \ No newline at end of file