mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Improve debug logging related for client-side errors and sandbox crashes.
Summary: - Include docId when available for client-side error reporting - Distinguish sandbox crashes from forced exits Test Plan: Tested manually Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3373
This commit is contained in:
@@ -177,11 +177,13 @@ export function setUpErrorHandling(doReportError = reportError, koUtil?: any) {
|
||||
*/
|
||||
function _logError(error: Error|string) {
|
||||
if (!pageHasHome()) { return; }
|
||||
const docId = G.window.gristDocPageModel?.currentDocId?.get();
|
||||
fetchFromHome('/api/log', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
// Errors don't stringify, so pick out properties explicitly for errors.
|
||||
event: (error instanceof Error) ? pick(error, Object.getOwnPropertyNames(error)) : error,
|
||||
docId,
|
||||
page: G.window.location.href,
|
||||
browser: pick(G.window.navigator, ['language', 'platform', 'userAgent'])
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user