Use reason code

This commit is contained in:
Girish Ramakrishnan
2019-09-05 18:15:05 -07:00
parent ff16a4334f
commit 609bae4f1a

View File

@@ -221,10 +221,13 @@ app.filter('prettyAppMessage', function () {
if (app.health === HSTATES.UNHEALTHY) return 'The app is not responding to health checks. Check the logs for any error messages.';
}
var message = app.error ? app.error.message : '';
if (message === 'ETRYAGAIN') return 'The DNS record for this location is not setup correctly. Please verify your DNS settings and repair this app.';
if (message === 'DNS Record already exists') return 'The DNS record for this location already exists. Cloudron does not remove existing DNS records. Manually remove the DNS record and then click on repair.';
return message;
if (app.error.reason === 'Access Denied') {
if (app.error.domain) return 'The DNS record for this location is not setup correctly. Please verify your DNS settings and repair this app.';
} else if (app.error.reason === 'Already Exists') {
if (app.error.domain) return 'The DNS record for this location already exists. Cloudron does not remove existing DNS records. Manually remove the DNS record and then click on repair.';
}
return app.error.message;
};
});