if (error.hasOwnProperty('status')&&error.status==401){
varemsg:string="";
this.notifications.notify("Your login appears to have expired. Please log in again",()=>{this.authService.updateAgentContents().subscribe((_)=>{return})});
if (error.hasOwnProperty('error')&&error.error.hasOwnProperty('message')){
return;
emsg=error.error.message;
}else{
emsg=error.message;
}
if (identity.expiry<Date.now()||(error.hasOwnProperty("status")&&error.status==401)){
this.notifications.notify("Your login has expired. Please log in again",()=>{this.authService.updateAgentContents().subscribe(()=>{return})});
returnthrowError(error);
}
if (error.hasOwnProperty("status")&&error.status==500){
this.notifications.notify("The Strudel2 API server had an error.\n Please report this via the contact us link.\nThe error message was"+emsg);
returnof([]);
}
}
this.tsub.unsubscribe();
if (error.hasOwnProperty("status")&&error.status==400){
if (identity.expiry<Date.now()){
this.notifications.notify(cmd+" unexpectedly returned an error message.\n Please report this vai the contact us link.\nThe error message was\n"+emsg);
this.notifications.notify("Your login has expired. Please log in again",()=>{this.authService.updateAgentContents().subscribe((_)=>{return})});
returnthrowError(error);
return;
}
}
console.error('getJobsError id',identity);
if (error.hasOwnProperty("status")&&error.status==504){
if (error.hasOwnProperty("error")&&error.error.hasOwnProperty("message")){
this.notifications.notify("The Server timed out while retrieveing a list of running jobs. Is the application server OK?");
if (error.error.message.indexOf("Permission denied")!=-1){
returnof([]);
this.notifications.notify("Your login appears to have expired. Please log in again",()=>{this.authService.updateAgentContents().subscribe((_)=>{return})});
return;
}
this.notifications.notify("Unable to retrieve a list of running jobs.\nThe error messge was "+error.error.message);
console.log(error);
return;
}
}
if (error.errorinstanceofErrorEvent){
this.notifications.notify("A networking error occured. Is your internet connection OK?")
returnthrowError(error);
}
}
publicgetJobsError(error,identity:Identity){
console.error(error);
console.error(error);
this.notifications.notify("Unable to retrieve a list of running jobs.\nThe error wasn't specified\nPlease report what you were doign via the contact us link",()=>{this.authService.updateAgentContents().subscribe((_)=>{return})});
this.notifications.notify("Unable to retrieve a list of running jobs.\nThis is probably an error on our end.\nPlease report what you were doing via the contact us link",()=>{this.authService.updateAgentContents().subscribe((_)=>{return})});
// (data,tunnelresp) => { data[1]['localport'] = (<any> tunnelresp)['localport'] ; return data}), // we don't care about data from the tunnel as long as it was successful.`
(data,tunnelresp)=>{data[1]['localport']=(<any>tunnelresp)['localport'];returndata}),// we don't care about data from the tunnel as long as it was successful.`
if (error.hasOwnProperty('error')&&error.error.hasOwnProperty('message')){
emsg=error.error.message;
}else{
emsg=error.message;
}
if (job.identity.expiry<Date.now()||(error.hasOwnProperty("status")&&error.status==401)){
this.notifications.notify("Your login has expired. Please log in again",()=>{this.authorisationService.updateAgentContents().subscribe(()=>{return})});
this.notifications.notify("Your login has expired. Please log in again",()=>{this.authorisationService.updateAgentContents().subscribe(()=>{return})});