update
Took 14 minutes
This commit is contained in:
parent
b7fd5f87bc
commit
422b210e73
@ -9,14 +9,19 @@ export class ErrorHandler {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let encrypted = Buffer.from(encrypter.encrypt(error.toJson())).toString("base64");
|
||||
|
||||
axios.post('https://itender.iif.li/report/send', encrypted, {headers: {"Content-Type": "text/plain", Accept: "application/json"}} ).then(res => {
|
||||
if( res.status != 200 )
|
||||
reject();
|
||||
axios.post('https://itender.iif.li/report/send', encrypted, {
|
||||
headers: {
|
||||
"Content-Type": "text/plain",
|
||||
Accept: "application/json"
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.status != 200)
|
||||
console.error("Could not send error report");
|
||||
else
|
||||
return resolve();
|
||||
|
||||
console.log("Error report was sent to iTender Manager");
|
||||
}).catch((e) => reject(e));
|
||||
}).catch((e) => console.error);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -26,10 +31,12 @@ export class InternalError {
|
||||
private readonly stack: string;
|
||||
private readonly name: string;
|
||||
|
||||
constructor(message: string, stack: string|undefined, name?: string) {
|
||||
constructor(message: string, stack: string | undefined, name?: string) {
|
||||
this.message = message;
|
||||
this.stack = stack ? stack : "";
|
||||
this.name = name ? name : "";
|
||||
|
||||
console.error(`\n-------- [INTERNAL ERROR] --------\nName: ${this.name}\nMessage: ${this.message}\nStack: ${this.stack}\n\n`)
|
||||
}
|
||||
|
||||
public toJson(): string {
|
||||
|
@ -307,7 +307,7 @@ router.ws('/', async (ws, req, next) => {
|
||||
try {
|
||||
let result = await exec(path.join(global.appRoot, "/../update.sh"));
|
||||
if (result.stderr)
|
||||
await WebSocketHandler.send(new WebSocketPayload(WebSocketEvent.ERROR, "Der iTender konnte das Update nicht installieren.<br>Möglicherweise ist die Internetverbindung nicht ausreichend oder das Update enthält Fehler.<br>"));
|
||||
await WebSocketHandler.send(new WebSocketPayload(WebSocketEvent.ERROR, "Der iTender konnte das Update nicht installieren.<br>Möglicherweise ist die Internetverbindung nicht ausreichend oder das Update enthält Fehler.<br><br><em>" + result.stderr + "</em>"));
|
||||
let error = new InternalError("Update request from user-interface failed while executing update script", result.stderr, result.code);
|
||||
await ErrorHandler.sendError(error);
|
||||
} catch (e) {
|
||||
|
@ -135,6 +135,7 @@ export class WebWebSocketHandler {
|
||||
modal.addContent(document.createElement("br"));
|
||||
modal.addButton(ButtonType.SECONDARY, "Schließen", () => modal.close());
|
||||
modal.open();
|
||||
Settings.inUpdate = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user