         service = createService (err, info) ->
             DNODE.connect DEFAULT_MONITOR_PORT, DEFAULT_OPTS.hostname, (remote) ->
                 remote.restart_app 'default-app', (err, result) ->
+                    if err then return done(new Error(err.message))
                     expect(result).toBe('default-app')
                     return done()
                 return

                name: 'default-app'
                hostname: 'replaced.example.com'
            registerRestartWebapp app, (err) ->
                if err then return done(err)
                opts =
                    uri: "http://localhost:8000"
                    headers: {'host': 'replaced.example.com'}

                    name: 'default-app'
                    hostname: 'default.example.com'
                registerRestartWebapp app, (err) ->
                    if err then return done(new Error(err.message))
                    return done()
                return
            return
        return
