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

error handle

parent 4609776d
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
} }
#loading > img { #loading > img {
width: 300px; width: 300px;
} }
...@@ -47,5 +48,21 @@ ...@@ -47,5 +48,21 @@
<p>LOADING <span>.</span> <span>.</span> <span>.</span></p> <p>LOADING <span>.</span> <span>.</span> <span>.</span></p>
</div> </div>
</app-root> </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> </body>
</html> </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