Add error handler for devices that fail to initialize.

Do not start work if devices fail to initialize and throw err insted.