handle error in js

1
2
3
4
5
try {
something
} catch (e) {
window.location.href = `http://stackoverflow.com/search?q=[js]${e.message}`
}