Contacts: Better error reporting.
This commit is contained in:
parent
6066ea3170
commit
b654121b50
|
@ -53,11 +53,12 @@ class OC_Contacts_App {
|
||||||
if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()) {
|
if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()) {
|
||||||
if ($addressbook === false) {
|
if ($addressbook === false) {
|
||||||
OC_Log::write('contacts', 'Addressbook not found: '. $id, OC_Log::ERROR);
|
OC_Log::write('contacts', 'Addressbook not found: '. $id, OC_Log::ERROR);
|
||||||
|
OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Addressbook not found.'))));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
OC_Log::write('contacts', 'Addressbook('.$id.') is not from '.OC_User::getUser(), OC_Log::ERROR);
|
OC_Log::write('contacts', 'Addressbook('.$id.') is not from '.OC_User::getUser(), OC_Log::ERROR);
|
||||||
|
OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('This is not your addressbook.'))));
|
||||||
}
|
}
|
||||||
OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('This is not your addressbook.')))); // Same here (as with the contact error). Could this error be improved?
|
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
return $addressbook;
|
return $addressbook;
|
||||||
|
|
Loading…
Reference in New Issue