[backend/core] Improve logging
This commit is contained in:
parent
07f0223c99
commit
f724a55901
2 changed files with 5 additions and 4 deletions
|
@ -70,14 +70,15 @@ public class WebFingerService(
|
|||
var split = query.Split('@');
|
||||
domain = split.Length switch
|
||||
{
|
||||
< 2 or > 3 => throw new GracefulException(HttpStatusCode.BadRequest, "Invalid query"),
|
||||
2 => throw new GracefulException(HttpStatusCode.BadRequest, "Can't run WebFinger for local user"),
|
||||
< 2 or > 3 => throw new GracefulException(HttpStatusCode.BadRequest, $"Invalid query: {query}"),
|
||||
2 => throw new GracefulException(HttpStatusCode.BadRequest,
|
||||
$"Can't run WebFinger for local user: {query}"),
|
||||
_ => split[2]
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new GracefulException(HttpStatusCode.BadRequest, "Invalid query");
|
||||
throw new GracefulException(HttpStatusCode.BadRequest, $"Invalid query: {query}");
|
||||
}
|
||||
|
||||
return (query, proto, domain);
|
||||
|
|
|
@ -49,7 +49,7 @@ public class UserService(
|
|||
|
||||
private (string Username, string? Host) AcctToTuple(string acct)
|
||||
{
|
||||
if (!acct.StartsWith("acct:")) throw new GracefulException(HttpStatusCode.BadRequest, "Invalid query");
|
||||
if (!acct.StartsWith("acct:")) throw new GracefulException(HttpStatusCode.BadRequest, $"Invalid query: {acct}");
|
||||
|
||||
var split = acct[5..].Split('@');
|
||||
if (split.Length != 2)
|
||||
|
|
Loading…
Add table
Reference in a new issue