You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
309 B
15 lines
309 B
4 years ago
|
'use strict'
|
||
|
module.exports = Base => class extends Base {
|
||
|
warn (msg, data) {
|
||
|
if (!this.strict)
|
||
|
this.emit('warn', msg, data)
|
||
|
else if (data instanceof Error)
|
||
|
this.emit('error', data)
|
||
|
else {
|
||
|
const er = new Error(msg)
|
||
|
er.data = data
|
||
|
this.emit('error', er)
|
||
|
}
|
||
|
}
|
||
|
}
|