]> git.mxchange.org Git - friendica.git/commitdiff
Improved error message
authorMichael <heluecht@pirati.ca>
Sun, 3 Jun 2018 09:55:41 +0000 (09:55 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 3 Jun 2018 09:55:41 +0000 (09:55 +0000)
include/api.php

index 94adecf0c0afe5a225daee72a8e5b5e93ccc12df..e93f44f2e0b975f3495d52224c27528d0ec8c367 100644 (file)
@@ -532,7 +532,7 @@ function api_get_user(App $a, $contact_id = null)
                $user = dbesc(api_unique_id_to_nurl(intval($contact_id)));
 
                if ($user == "") {
-                       throw new BadRequestException("User not found.");
+                       throw new BadRequestException("User ID ".$contact_id." not found.");
                }
 
                $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']));
 
                if ($user == "") {
-                       throw new BadRequestException("User not found.");
+                       throw new BadRequestException("User ID ".$_GET['user_id']." not found.");
                }
 
                $url = $user;
@@ -677,7 +677,7 @@ function api_get_user(App $a, $contact_id = null)
 
                        return $ret;
                } 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];
                } else {
-                       throw new BadRequestException("User not found.");
+                       throw new BadRequestException("User ".$_GET["q"]." not found.");
                }
        } else {
-               throw new BadRequestException("User not found.");
+               throw new BadRequestException("No user specified.");
        }
 
        return api_format_data("users", $type, $userlist);