How to use the builder-util-runtime.HttpError function in builder-util-runtime

To help you get started, we’ve selected a few builder-util-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-builder / packages / electron-builder-lib / src / remoteBuilder / RemoteBuildManager.ts View on Github external
stream.on("response", headers => {
        const status: number = headers[HTTP2_HEADER_STATUS] as any
        if (status !== HTTP_STATUS_OK) {
          reject(new HttpError(status))
          return
        }

        stream.pipe(StreamValues.withParser())
          .on("data", (object: any) => {
            const data = object.value
            if (log.isDebugEnabled) {
              log.debug({event: JSON.stringify(data, null, 2)}, "remote builder event")
            }

            if (data.status != null) {
              log.info({status: data.status}, "remote building")
            }
            else if ("error" in data) {
              resolve({files: null, error: data.error})
            }
github electron-userland / electron-builder / packages / electron-builder-lib / src / remoteBuilder / RemoteBuildManager.ts View on Github external
export function checkStatus(status: number, reject: (error: Error) => void) {
  if (status === HTTP_STATUS_OK) {
    return true
  }
  else {
    reject(new HttpError(status))
    return false
  }
}