|
@@ -5,19 +5,25 @@ const reportErr=(app)=>{
|
|
|
let errObj={}
|
|
|
|
|
|
app.config.errorHandler=(err, instance, info)=>{
|
|
|
+ console.error(err)
|
|
|
errObj={
|
|
|
msg:err.message,
|
|
|
stack:err.stack
|
|
|
}
|
|
|
- apiReportingErrInfo({errInfo:errObj})
|
|
|
+ if(import.meta.env.MODE==='production'){
|
|
|
+ apiReportingErrInfo({errInfo:errObj})
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
window.addEventListener('error',(e)=>{
|
|
|
+ console.error(e)
|
|
|
errObj={
|
|
|
- msg:e.error.message,
|
|
|
- stack:e.error.stack
|
|
|
+ msg:e.error?.message,
|
|
|
+ stack:e.error?.stack
|
|
|
+ }
|
|
|
+ if(import.meta.env.MODE==='production'){
|
|
|
+ apiReportingErrInfo({errInfo:errObj})
|
|
|
}
|
|
|
- apiReportingErrInfo({errInfo:errObj})
|
|
|
})
|
|
|
}
|
|
|
|