Commit 4abec5fd authored by 神楽坂玲奈's avatar 神楽坂玲奈

error handle

parent 4609776d
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-root',
......
......@@ -23,6 +23,7 @@
align-items: center;
flex-direction: column;
}
#loading > img {
width: 300px;
}
......@@ -47,5 +48,21 @@
<p>LOADING <span>.</span> <span>.</span> <span>.</span></p>
</div>
</app-root>
<script>
window.onerror = function (msg, url, lineNo, columnNo, error) {
if (msg.toLowerCase().indexOf('script error') > -1) {
alert('Script Error: See Browser Console for Detail');
} else {
alert([
'Message: ' + msg,
'URL: ' + url,
'Line: ' + lineNo,
'Column: ' + columnNo,
'Error object: ' + JSON.stringify(error)
].join('\n'));
}
return false;
};
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment