throwException instead of throwing exceptions manually (includes stacktrace)

This commit is contained in:
azivner
2017-12-06 19:53:23 -05:00
parent a7831ebfcd
commit a0bbd8c853
9 changed files with 16 additions and 12 deletions

View File

@@ -30,6 +30,10 @@ function showError(message) {
});
}
function throwError(message) {
throw new Error(message + ':' + new Error().stack);
}
function getDateFromTS(timestamp) {
// Date accepts number of milliseconds since epoch so UTC timestamp works without any extra handling
// see https://stackoverflow.com/questions/4631928/convert-utc-epoch-to-local-date-with-javascript