Do not show scary red error notifications on timeouts or other 500

Instead dump to terminal with email instructions
This commit is contained in:
Johannes Zellner
2021-03-29 10:37:11 +02:00
parent ee0c50bea2
commit c9628970d9
+5 -1
View File
@@ -238,7 +238,11 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
if (status === 401) return client.login();
if (status === 500 || status === 501) {
if (!client.offline) client.error(data);
// actual internal server error, most likely a bug or timeout log to console only to not alert the user
if (!client.offline) {
console.error(status, data);
console.log('------\nCloudron Internal Error\n\nIf you see this, please send a mail with above log to support@cloudron.io\n------\n');
}
} else if (status === 502 || status === 503 || status === 504) {
// This means the box service is not reachable. We just show offline banner for now
}