[CST-4880] Set 500 response status to internal server error page

This commit is contained in:
Giuseppe Digilio
2022-01-20 14:24:54 +01:00
parent 7e7ad9a4f3
commit fd610dbf4d
2 changed files with 15 additions and 1 deletions

View File

@@ -31,4 +31,8 @@ export class ServerResponseService {
setNotFound(message = 'Not found'): this {
return this.setStatus(404, message);
}
setInternalServerError(message = 'Internal Server Error'): this {
return this.setStatus(500, message);
}
}

View File

@@ -1,7 +1,8 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ServerResponseService } from '../core/services/server-response.service';
/**
* This component representing the `PageNotFound` DSpace page.
* This component representing the `PageInternalServer` DSpace page.
*/
@Component({
selector: 'ds-page-internal-server-error',
@@ -10,4 +11,13 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
changeDetection: ChangeDetectionStrategy.Default
})
export class PageInternalServerErrorComponent {
/**
* Initialize instance variables
*
* @param {ServerResponseService} responseService
*/
constructor(private responseService: ServerResponseService) {
this.responseService.setInternalServerError();
}
}