mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-14 14:56:32 +00:00
fix(GUI): Warn when requiring usb fails
Change-type: patch Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
This commit is contained in:
parent
7a2dac8d5b
commit
b9f9968f84
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const Bluebird = require('bluebird')
|
const Bluebird = require('bluebird')
|
||||||
|
const analytics = require('../../../gui/app/modules/analytics')
|
||||||
|
|
||||||
// The USB module calls `libusb_init`, which will fail
|
// The USB module calls `libusb_init`, which will fail
|
||||||
// if the device we're running in has no USB controller
|
// if the device we're running in has no USB controller
|
||||||
@ -28,6 +29,7 @@ const usb = (() => {
|
|||||||
try {
|
try {
|
||||||
return require('usb')
|
return require('usb')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
analytics.logException(error)
|
||||||
return {
|
return {
|
||||||
getDeviceList: _.constant([])
|
getDeviceList: _.constant([])
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user