[backend/federation] Improve log handling in AuthorizedFetchMiddleware

This commit is contained in:
Laura Hausmann 2024-02-18 01:05:06 +01:00
parent 157fd20315
commit b46e587132
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -47,6 +47,8 @@ public class AuthorizedFetchMiddleware(
UserPublickey? key = null;
var verified = false;
logger.LogTrace("Processing authorized fetch request for {path}", request.Path);
try
{
@ -101,7 +103,8 @@ public class AuthorizedFetchMiddleware(
}
catch (Exception e)
{
logger.LogDebug("Error validating HTTP signature: {error}", e.ToString());
if (e is GracefulException { SuppressLog: true }) throw;
logger.LogDebug("Error validating HTTP signature: {error}", e.Message);
}
logger.LogDebug("Trying LD signature next...");
@ -162,7 +165,8 @@ public class AuthorizedFetchMiddleware(
}
catch (Exception e)
{
logger.LogError("Error validating JSON-LD signature: {error}", e.ToString());
if (e is GracefulException { SuppressLog: true }) throw;
logger.LogError("Error validating JSON-LD signature: {error}", e.Message);
}
}