Commit ace1d9cb authored by dev0tion's avatar dev0tion

Use error description instead of message

parent c35b3160
...@@ -98,6 +98,7 @@ export class CreateComponent { ...@@ -98,6 +98,7 @@ export class CreateComponent {
} }
}, },
error => { error => {
console.log(error);
if (error.status === 0) { if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application."); alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) { } else if (error.status >= 400) {
...@@ -105,7 +106,7 @@ export class CreateComponent { ...@@ -105,7 +106,7 @@ export class CreateComponent {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].message); alert(error.json().errors[0].description);
} }
} }
} }
......
...@@ -112,6 +112,7 @@ export class RecoverComponent implements OnInit { ...@@ -112,6 +112,7 @@ export class RecoverComponent implements OnInit {
} }
}, },
error => { error => {
console.log(error);
if (error.status === 0) { if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application."); alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) { } else if (error.status >= 400) {
...@@ -119,7 +120,7 @@ export class RecoverComponent implements OnInit { ...@@ -119,7 +120,7 @@ export class RecoverComponent implements OnInit {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].message); alert(error.json().errors[0].description);
} }
} }
} }
......
...@@ -10,7 +10,6 @@ import { ReceiveComponent } from '../receive/receive.component'; ...@@ -10,7 +10,6 @@ import { ReceiveComponent } from '../receive/receive.component';
import { Observable } from 'rxjs/Rx'; import { Observable } from 'rxjs/Rx';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/first';
@Component({ @Component({
selector: 'dashboard-component', selector: 'dashboard-component',
...@@ -57,6 +56,7 @@ export class DashboardComponent { ...@@ -57,6 +56,7 @@ export class DashboardComponent {
} }
}, },
error => { error => {
console.log(error);
if (error.status === 0) { if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application."); alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) { } else if (error.status >= 400) {
...@@ -64,7 +64,7 @@ export class DashboardComponent { ...@@ -64,7 +64,7 @@ export class DashboardComponent {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].message); alert(error.json().errors[0].description);
} }
} }
} }
...@@ -84,6 +84,7 @@ export class DashboardComponent { ...@@ -84,6 +84,7 @@ export class DashboardComponent {
} }
}, },
error => { error => {
console.log(error);
if (error.status === 0) { if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application."); alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) { } else if (error.status >= 400) {
...@@ -91,7 +92,7 @@ export class DashboardComponent { ...@@ -91,7 +92,7 @@ export class DashboardComponent {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].message); alert(error.json().errors[0].description);
} }
} }
} }
......
...@@ -41,6 +41,7 @@ export class HistoryComponent { ...@@ -41,6 +41,7 @@ export class HistoryComponent {
} }
}, },
error => { error => {
console.log(error);
if (error.status === 0) { if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application."); alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) { } else if (error.status >= 400) {
...@@ -48,7 +49,7 @@ export class HistoryComponent { ...@@ -48,7 +49,7 @@ export class HistoryComponent {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].message); alert(error.json().errors[0].description);
} }
} }
} }
......
...@@ -33,6 +33,7 @@ export class ReceiveComponent { ...@@ -33,6 +33,7 @@ export class ReceiveComponent {
} }
}, },
error => { error => {
console.log(error);
if (error.status === 0) { if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application."); alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) { } else if (error.status >= 400) {
...@@ -40,7 +41,7 @@ export class ReceiveComponent { ...@@ -40,7 +41,7 @@ export class ReceiveComponent {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].message); alert(error.json().errors[0].description);
} }
} }
} }
......
...@@ -132,6 +132,7 @@ export class SendComponent { ...@@ -132,6 +132,7 @@ export class SendComponent {
} }
}, },
error => { error => {
console.log(error);
if (error.status === 0) { if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application."); alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) { } else if (error.status >= 400) {
...@@ -139,7 +140,7 @@ export class SendComponent { ...@@ -139,7 +140,7 @@ export class SendComponent {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].message); alert(error.json().errors[0].description);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment