add logging for patches
This commit is contained in:
parent
d1dc8140e4
commit
6d1dbfad1e
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import WebpackModules from './webpackmodules';
|
import WebpackModules from './webpackmodules';
|
||||||
|
import { ClientLogger as Logger } from 'common';
|
||||||
|
|
||||||
export default class Patcher {
|
export default class Patcher {
|
||||||
static get patches() { return this._patches || (this._patches = {}) }
|
static get patches() { return this._patches || (this._patches = {}) }
|
||||||
|
@ -23,13 +24,17 @@ export default class Patcher {
|
||||||
for (const s of patch.supers) {
|
for (const s of patch.supers) {
|
||||||
try {
|
try {
|
||||||
s.fn.apply(this, arguments);
|
s.fn.apply(this, arguments);
|
||||||
} catch (err) { }
|
} catch (err) {
|
||||||
|
Logger.err('Patcher', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const retVal = patch.ofn.apply(this, arguments);
|
const retVal = patch.ofn.apply(this, arguments);
|
||||||
for (const s of patch.slaves) {
|
for (const s of patch.slaves) {
|
||||||
try {
|
try {
|
||||||
s.fn.apply(this, [arguments, { patch, retVal }]);
|
s.fn.apply(this, [arguments, { patch, retVal }]);
|
||||||
} catch (err) { }
|
} catch (err) {
|
||||||
|
Logger.err('Patcher', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue