Skip to content

Commit fde96d2

Browse files
committed
basic error handling
1 parent ee656b4 commit fde96d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

index.html

+9-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ <h2>Sample Chart with Restricted Data</h2>
130130
);
131131
}
132132
};
133-
request.open("GET", data_url, true);
133+
request.onloadend = function() {
134+
if(request.status == 403) {
135+
console.log('Not authorized for the data, got a 403');
136+
UI.USER_INFO.innerText = `${manager.user.name}, you are not authorized to load the data. Did you join the the Serverless Data Users Globus Group?`;
137+
UI.CHART.style.display = 'none';
138+
UI.CANVAS.style.display = 'none';
139+
};
140+
};
141+
request.open("GET", data_url, true);
134142
request.setRequestHeader('Authorization', `Bearer ${access_token}`);
135143
request.send();
136144
} else {

0 commit comments

Comments
 (0)