mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 22:23:13 +00:00
Bring back request - and show an error when talking to delta server fails
This commit is contained in:
parent
1a5a9b0e23
commit
5b48856c9a
@ -7,6 +7,8 @@ config = require './config'
|
||||
_ = require 'lodash'
|
||||
knex = require './db'
|
||||
|
||||
{ request } = require './request'
|
||||
|
||||
docker = Promise.promisifyAll(new Docker(socketPath: config.dockerSocket))
|
||||
# Hack dockerode to promisify internal classes' prototypes
|
||||
Promise.promisifyAll(docker.getImage().constructor.prototype)
|
||||
@ -56,7 +58,7 @@ exports.rsyncImageWithProgress = (imgDest, onProgress) ->
|
||||
onProgress(percentage: 100)
|
||||
.on 'response', (res) ->
|
||||
if res.statusCode isnt 200
|
||||
reject()
|
||||
reject(new Error("Got #{res.statusCode} when requesting image from delta server."))
|
||||
else
|
||||
resolve(res)
|
||||
.on 'error', reject
|
||||
|
Loading…
Reference in New Issue
Block a user