mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Reduce a few log levels to warning
Summary: Reduces the log level in a few places from error to warning. Test Plan: N/A Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3437
This commit is contained in:
parent
3ddeb511e8
commit
bad4c68569
@ -75,7 +75,11 @@ export class DocWorker {
|
||||
return res.type('application/x-sqlite3')
|
||||
.download(tmpPath, (optStringParam(req.query.title) || docTitle || 'document') + ".grist", async (err: any) => {
|
||||
if (err) {
|
||||
log.error(`Download failure for doc ${docId}`, err);
|
||||
if (err.message && /Request aborted/.test(err.message)) {
|
||||
log.warn(`Download request aborted for doc ${docId}`, err);
|
||||
} else {
|
||||
log.error(`Download failure for doc ${docId}`, err);
|
||||
}
|
||||
}
|
||||
await fse.unlink(tmpPath);
|
||||
});
|
||||
|
@ -54,7 +54,11 @@ export function addUploadRoute(server: GristServer, expressApp: Application, ...
|
||||
res.status(200).send(JSON.stringify(uploadResult));
|
||||
} catch (err) {
|
||||
req.resume();
|
||||
log.error("Error uploading file", err);
|
||||
if (err.message && /Request aborted/.test(err.message)) {
|
||||
log.warn("File upload request aborted", err);
|
||||
} else {
|
||||
log.error("Error uploading file", err);
|
||||
}
|
||||
// Respond with a JSON error like jsonErrorHandler does for API calls,
|
||||
// to make it easier for the caller to parse it.
|
||||
res.status(err.status || 500).json({error: err.message || 'internal error'});
|
||||
|
Loading…
Reference in New Issue
Block a user