From 24e18b7a3d741edc7b87aa1c27ece6141645312c Mon Sep 17 00:00:00 2001 From: Norwin Roosen Date: Tue, 22 Jan 2019 14:36:44 +0100 Subject: [PATCH] increase compiler timeout to 30sec needed when including SenseboxMCU.h --- src/providers/compiler/compiler.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/providers/compiler/compiler.ts b/src/providers/compiler/compiler.ts index 9ea9d66..a6a54fa 100644 --- a/src/providers/compiler/compiler.ts +++ b/src/providers/compiler/compiler.ts @@ -13,15 +13,18 @@ export class CompilerProvider { } async callcompiler(sketch : string): Promise { - const headers = new HttpHeaders({'Content-Type': 'application/json'} ); + const headers = new HttpHeaders({'Content-Type': 'application/json'} ); const data = { board: 'sensebox-mcu', sketch } // send compilation request, returning a job ID return this.http.post(`${URL}/compile`, data, { headers }) - .pipe(timeout(4000)) + .pipe(timeout(30000)) .toPromise() .catch(err => { - let msg = 'unable to contact web compiler. are you online?' + let msg = err.message + if (err.name === 'TimeoutError') + msg = 'unable to contact web compiler. are you online?' + try { // attempt to extract the compilation error message and clean it up msg = JSON.parse(err.error.message).process