aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/error-bar
diff options
context:
space:
mode:
authorKamen Mladenov <kamen.d.mladenov@protonmail.com>2021-04-09 19:55:59 +0300
committerGitHub <noreply@github.com>2021-04-09 19:55:59 +0300
commitf849e37ccdd6fd48f83119a3b3b65cdd8b765dc3 (patch)
tree83b88a773bb7dc053bb3aced35bce302264ec925 /src/app/components/error-bar
parentbcd88af53b1a920d728ec98b45daa9ac2e2c0917 (diff)
parentc13889759d70687de6833c505221c203f65fedb8 (diff)
downloadDevHive-Angular-f849e37ccdd6fd48f83119a3b3b65cdd8b765dc3.tar
DevHive-Angular-f849e37ccdd6fd48f83119a3b3b65cdd8b765dc3.tar.gz
DevHive-Angular-f849e37ccdd6fd48f83119a3b3b65cdd8b765dc3.zip
Merge pull request #7 from Team-Kaleidoscope/devHEADv0.2main
Second Stage: Complete
Diffstat (limited to 'src/app/components/error-bar')
-rw-r--r--src/app/components/error-bar/error-bar.component.css2
-rw-r--r--src/app/components/error-bar/error-bar.component.ts18
2 files changed, 11 insertions, 9 deletions
diff --git a/src/app/components/error-bar/error-bar.component.css b/src/app/components/error-bar/error-bar.component.css
index 8f8edd9..880f205 100644
--- a/src/app/components/error-bar/error-bar.component.css
+++ b/src/app/components/error-bar/error-bar.component.css
@@ -5,6 +5,8 @@
color: white;
padding: .2em;
text-align: center;
+ word-wrap: break-word;
+ white-space: pre-wrap;
}
#error-bar:empty {
diff --git a/src/app/components/error-bar/error-bar.component.ts b/src/app/components/error-bar/error-bar.component.ts
index 111bac8..277552b 100644
--- a/src/app/components/error-bar/error-bar.component.ts
+++ b/src/app/components/error-bar/error-bar.component.ts
@@ -1,6 +1,5 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
-import { IApiError } from 'src/interfaces/api-error';
@Component({
selector: 'app-error-bar',
@@ -18,14 +17,15 @@ export class ErrorBarComponent implements OnInit {
}
showError(error: HttpErrorResponse): void {
- const test: IApiError = {
- type: '',
- title: 'Error!',
- status: 0,
- traceId: ''
- };
- Object.assign(test, error.error);
- this.errorMsg = test.title;
+ this.errorMsg = '';
+
+ const errors: string[][] = Object.values(Object.values(error.error)[0] as any);
+
+ for (const errorArr of errors) {
+ for (const errorMsg of errorArr) {
+ this.errorMsg += errorMsg + '\n';
+ }
+ }
}
hideError(): void {