Merge branch 'ben/fix/error-messages' into ben/feature/push-notifications
This commit is contained in:
commit
bff385be74
3 changed files with 20 additions and 2 deletions
|
@ -103,7 +103,18 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AppModule {
|
export class AppModule {
|
||||||
constructor () {
|
constructor (
|
||||||
|
private api: ApiService,
|
||||||
|
) {
|
||||||
|
this.api.checkDatabaseConnection().subscribe(
|
||||||
|
result => {
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
document.location = '#/500';
|
||||||
|
throw new Error('Server connection fail');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (environment.enableAnalytics) {
|
if (environment.enableAnalytics) {
|
||||||
(<any>window).ga('create', environment.analyticsKey, 'auto');
|
(<any>window).ga('create', environment.analyticsKey, 'auto');
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<h1 class="float-left display-3 mr-4">500</h1>
|
<h1 class="float-left display-3 mr-4">500</h1>
|
||||||
<h4 class="pt-3">Houston, we have a problem!</h4>
|
<h4 class="pt-3">Houston, we have a problem!</h4>
|
||||||
<p class="text-muted">The page you are looking for is temporarily unavailable.</p>
|
<p class="text-muted">Server connection unavailable.</p>
|
||||||
</div>
|
</div>
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary btn-lg" type="button"(click)="goBack()">Go Back</button>
|
<button class="btn btn-primary btn-lg" type="button"(click)="goBack()">Go Back</button>
|
||||||
|
|
|
@ -41,6 +41,13 @@ export class ApiService {
|
||||||
localStorage.removeItem('sessionKey');
|
localStorage.removeItem('sessionKey');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public checkDatabaseConnection() {
|
||||||
|
return this.http.post<any>(
|
||||||
|
this.apiUrl,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public register(data) {
|
public register(data) {
|
||||||
return this.http.post<any>(
|
return this.http.post<any>(
|
||||||
this.apiUrl + '/register',
|
this.apiUrl + '/register',
|
||||||
|
|
Reference in a new issue