All files / src/app/pages/error/server-error server-error.component.ts

66.66% Statements 4/6
100% Branches 0/0
50% Functions 2/4
66.66% Lines 4/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 391x                                 1x             5x     12x                      
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
 
import { HttpError } from 'ish-core/models/http-error/http-error.model';
 
/**
 * The Server Error Page Component informs the user about an occurred error on server side.
 *
 * @example
 * <ish-server-error-page
 *               [error]="generalError"
 * ></ish-server-error-page>
 */
@Component({
  selector: 'ish-server-error',
  templateUrl: './server-error.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ServerErrorComponent {
  /**
   * The occurred error.
   */
  @Input({ required: true }) error: HttpError | string;
  @Input() type: string;
 
  expanded = false;
 
  get httpError() {
    return this.error as HttpError;
  }
 
  get stringError() {
    return this.error as string;
  }
 
  expand() {
    this.expanded = true;
  }
}