1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 02:09:32 +02:00

Wake up and unlock device when it's being used. A bit messy, pending refactor.

This commit is contained in:
Simo Kinnunen 2014-03-04 18:00:31 +09:00
parent 999e5113bf
commit a25df0b293
6 changed files with 183 additions and 20 deletions

View file

@ -1,6 +1,18 @@
var util = require('util')
var Promise = require('bluebird')
var split = require('split')
function NoSuchLineError(message) {
Error.call(this, message)
this.name = 'NoSuchLineError'
Error.captureStackTrace(this, NoSuchLineError)
}
util.inherits(NoSuchLineError, Error)
module.exports.NoSuchLineError = NoSuchLineError
module.exports.readAll = function(stream) {
var resolver = Promise.defer()
, collected = new Buffer(0)
@ -41,7 +53,7 @@ module.exports.findLine = function(stream, re) {
}
function endListener() {
resolver.reject(new Error('No matching line found'))
resolver.reject(new NoSuchLineError())
}
function lineListener(line) {