mirror of https://github.com/status-im/metro.git
Logger API error handling improvement
Summary: Defer Logger calls to the next tick queue so as to avoid potential Logger errors from falling under the purview of Promise error handling, which would degrade development experience by "swallowing" legitimate runtime errors within rejected promises, to the infuriation of us all :D Reviewed By: davidaurelio Differential Revision: D4197869 fbshipit-source-id: 10a44904be1404ad2534d06ddc56048c1c24f32b
This commit is contained in:
parent
40c3857d23
commit
038cfa8ebe
|
@ -475,7 +475,9 @@ class Server {
|
||||||
// This is safe as the asset url contains a hash of the asset.
|
// This is safe as the asset url contains a hash of the asset.
|
||||||
res.setHeader('Cache-Control', 'max-age=31536000');
|
res.setHeader('Cache-Control', 'max-age=31536000');
|
||||||
res.end(this._rangeRequestMiddleware(req, res, data, assetPath));
|
res.end(this._rangeRequestMiddleware(req, res, data, assetPath));
|
||||||
print(log(createActionEndEntry(processingAssetRequestLogEntry)), ['asset']);
|
process.nextTick(() => {
|
||||||
|
print(log(createActionEndEntry(processingAssetRequestLogEntry)), ['asset']);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
console.error(error.stack);
|
console.error(error.stack);
|
||||||
|
@ -747,7 +749,9 @@ class Server {
|
||||||
}).then(
|
}).then(
|
||||||
stack => {
|
stack => {
|
||||||
res.end(JSON.stringify({stack: stack}));
|
res.end(JSON.stringify({stack: stack}));
|
||||||
print(log(createActionEndEntry(symbolicatingLogEntry)));
|
process.nextTick(() => {
|
||||||
|
print(log(createActionEndEntry(symbolicatingLogEntry)));
|
||||||
|
});
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
console.error(error.stack || error);
|
console.error(error.stack || error);
|
||||||
|
|
Loading…
Reference in New Issue