Improved error message
This commit is contained in:
parent
b654af28fa
commit
6985ad4fb5
1 changed files with 5 additions and 5 deletions
|
@ -532,7 +532,7 @@ function api_get_user(App $a, $contact_id = null)
|
||||||
$user = dbesc(api_unique_id_to_nurl(intval($contact_id)));
|
$user = dbesc(api_unique_id_to_nurl(intval($contact_id)));
|
||||||
|
|
||||||
if ($user == "") {
|
if ($user == "") {
|
||||||
throw new BadRequestException("User not found.");
|
throw new BadRequestException("User ID ".$contact_id." not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $user;
|
$url = $user;
|
||||||
|
@ -546,7 +546,7 @@ function api_get_user(App $a, $contact_id = null)
|
||||||
$user = dbesc(api_unique_id_to_nurl($_GET['user_id']));
|
$user = dbesc(api_unique_id_to_nurl($_GET['user_id']));
|
||||||
|
|
||||||
if ($user == "") {
|
if ($user == "") {
|
||||||
throw new BadRequestException("User not found.");
|
throw new BadRequestException("User ID ".$_GET['user_id']." not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $user;
|
$url = $user;
|
||||||
|
@ -677,7 +677,7 @@ function api_get_user(App $a, $contact_id = null)
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("User not found.");
|
throw new BadRequestException("User ".$url." not found.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1541,10 +1541,10 @@ function api_users_search($type)
|
||||||
}
|
}
|
||||||
$userlist = ["users" => $userlist];
|
$userlist = ["users" => $userlist];
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("User not found.");
|
throw new BadRequestException("User ".$_GET["q"]." not found.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("User not found.");
|
throw new BadRequestException("No user specified.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return api_format_data("users", $type, $userlist);
|
return api_format_data("users", $type, $userlist);
|
||||||
|
|
Loading…
Reference in a new issue