mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-22 06:23:01 +00:00
[client] Exception -> Error
This commit is contained in:
parent
840619ef0d
commit
d011a61b7e
2 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,7 @@ class LayerDeviceMarkers {
|
||||||
|
|
||||||
async marker_popup_open_handler(device_id, event) {
|
async marker_popup_open_handler(device_id, event) {
|
||||||
if(typeof device_id !== "number")
|
if(typeof device_id !== "number")
|
||||||
throw new Exception("Error: Invalid device id passed.");
|
throw new Error("Error: Invalid device id passed.");
|
||||||
|
|
||||||
console.info("Fetching device info for device", device_id);
|
console.info("Fetching device info for device", device_id);
|
||||||
let device_info = JSON.parse(await GetFromUrl(`${Config.api_root}?action=device-info&device-id=${device_id}`));
|
let device_info = JSON.parse(await GetFromUrl(`${Config.api_root}?action=device-info&device-id=${device_id}`));
|
||||||
|
|
|
@ -104,9 +104,9 @@ class LayerHeatmap {
|
||||||
|
|
||||||
async update_data(datetime, reading_type) {
|
async update_data(datetime, reading_type) {
|
||||||
if(!(datetime instanceof Date))
|
if(!(datetime instanceof Date))
|
||||||
throw new Exception("Error: 'datetime' must be an instance of Date.");
|
throw new Error("Error: 'datetime' must be an instance of Date.");
|
||||||
if(typeof reading_type != "string")
|
if(typeof reading_type != "string")
|
||||||
throw new Exception("Error: 'reading_type' must be a string.");
|
throw new Error("Error: 'reading_type' must be a string.");
|
||||||
|
|
||||||
this.datetime = datetime;
|
this.datetime = datetime;
|
||||||
this.reading_type = reading_type;
|
this.reading_type = reading_type;
|
||||||
|
|
Loading…
Reference in a new issue