feat: add forgejo_error_reporter plugin for automatic error reporting to Forgejo issues
This commit is contained in:
@@ -74,4 +74,19 @@ async def report_error(error: ErrorReport, request: Request) -> Response:
|
||||
},
|
||||
)
|
||||
|
||||
# If forgejo_error_reporter plugin is active, forward error
|
||||
try:
|
||||
from app.plugins.builtins.forgejo_error_reporter.service import report_error_to_forgejo
|
||||
entry = {
|
||||
"message": error.message,
|
||||
"stack": error.stack,
|
||||
"url": error.url,
|
||||
"userAgent": error.userAgent,
|
||||
"timestamp": error.timestamp,
|
||||
"context": error.context,
|
||||
}
|
||||
await report_error_to_forgejo(entry)
|
||||
except Exception:
|
||||
pass # Plugin not active or error in reporting
|
||||
|
||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
Reference in New Issue
Block a user