命令崩溃时也上报错误

pull/333/MERGE
ChenX 5 years ago
parent 3df879a469
commit 255d62b918

@ -11,11 +11,16 @@ export class ErrorMonitoring
{
reportError(e.reason.stack);
});
}
}
async function reportError(stack: any)
export async function reportError(stack: any)
{
try
{
if (window.location.hostname !== "t.qcad.cc")
return;
console.log(stack);
await postData("http://192.168.1.251:25100/monitoring", {
stack,
@ -46,5 +51,3 @@ export class ErrorMonitoring
referrer: 'no-referrer',
});
}
}
}

@ -1,7 +1,8 @@
import { app } from '../ApplicationServices/Application';
import { JigUtils } from './JigUtils';
import { CommandState } from './CommandState';
import { arrayRemoveOnce } from '../Common/ArrayExt';
import { reportError } from '../Common/ErrorMonitoring';
import { CommandState } from './CommandState';
import { JigUtils } from './JigUtils';
export interface Command
{
exec: Function;//函数可以返回true,实现放弃命令的任何操作.
@ -40,6 +41,7 @@ class CommandMachine
catch (error)
{
console.error(error.stack);
reportError(error.stack);
app.m_Editor.Prompt("抱歉,命令造成了错误,请联系开发人员.");
}
this.CommandEnd(abort);

Loading…
Cancel
Save