mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Report JS errors to backend (#842)
This commit is contained in:
parent
13f8fa7e11
commit
a1b578f81e
10
js/core.js
10
js/core.js
@ -31,3 +31,13 @@ if (window.noAuth === '1') {
|
|||||||
} else {
|
} else {
|
||||||
window.hassConnection = null;
|
window.hassConnection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.addEventListener('error', (e) => {
|
||||||
|
const homeAssistant = document.querySelector('home-assistant');
|
||||||
|
if (homeAssistant && homeAssistant.hass && homeAssistant.hass.callService) {
|
||||||
|
homeAssistant.hass.callService('system_log', 'write', {
|
||||||
|
logger: `frontend.${window.HASS_DEV ? 'js_dev' : 'js'}.${window.HASS_BUILD}.${window.HASS_VERSION.replace('.', '')}`,
|
||||||
|
message: `${e.filename}:${e.lineno}:${e.colno} ${e.message}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user