Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onVideoError = () => {
log.error('onVideoError');
// log.debug(this);
this.onDurationChange(frameCountToSeconds(this.props.file.frameCount));
this.setState({
loadVideo: false
});
}
setTimeout(() => this.verifyAddress(index, current, display, cb, ++attempt), 500)
} else {
log.info('Verify Address Error: ')
// TODO: Error Notification
log.error(err)
this.signers.remove(this.id)
cb(new Error('Verify Address Error'))
}
} else {
const address = result.address ? result.address.toLowerCase() : ''
const current = this.addresses[index].toLowerCase()
log.info('Frame has the current address as: ' + current)
log.info('Trezor is reporting: ' + address)
if (address !== current) {
// TODO: Error Notification
log.error(new Error('Address does not match device'))
this.signers.remove(this.id)
cb(new Error('Address does not match device'))
} else {
log.info('Address matches device')
cb(null, true)
}
}
})
}
function errorOnMain(error) {
log.error(error);
log.error(error.stack);
console.error(error);
console.error(error.stack);
if (error.data) {
log.error(error.data);
console.error(error.data);
}
if (mainWindow) {
mainWindow.webContents.send('dispatch-action', {
type: 'errorOnMain',
payload: {
message: error.message,
stack: error.stack,
data: error.data
}
});
function errorOnMain(error) {
log.error(error);
log.error(error.stack);
console.error(error);
console.error(error.stack);
if (error.data) {
log.error(error.data);
console.error(error.data);
}
if (mainWindow) {
mainWindow.webContents.send('dispatch-action', {
type: 'errorOnMain',
payload: {
message: error.message,
stack: error.stack,
data: error.data
}
fs.unlink(filePath, (err2) => {
if (err2) {
log.error('Failed to delete', filePath, err);
reject(err2);
} else {
resolve('deleted');
}
});
}
.catch(err => {
log.error(err);
});
this.handleSubmit = e => {
e.preventDefault()
const errors = this.validate()
const invalid = Object.keys(errors).length > 0
this.setState({ errors })
if (invalid) return log.error(errors)
this.createApp()
}
constructor(...args: any[]) {
super(...args);
Error.captureStackTrace(this, LoggedError);
log.error(this);
}
}
err.message === 'Invalid channel' ||
err.message === 'DisconnectedDevice'
)
if (deviceBusy) {
clearTimeout(this._signMessage)
if (++this.busyCount > 20) {
this.busyCount = 0
return log.info('>>>>>>> Busy: Limit (10) hit, cannot open device with path, will not try again')
} else {
this._signMessage = setTimeout(() => this.signMessage(index, message, cb), 700)
return log.info('>>>>>>> Busy: cannot open device with path, will try again (signMessage)')
}
}
cb(err)
await this.releaseDevice()
log.error(err)
}
}