Commit ace1d9cb authored by dev0tion's avatar dev0tion

Use error description instead of message

parent c35b3160
......@@ -98,6 +98,7 @@ export class CreateComponent {
}
},
error => {
console.log(error);
if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
......@@ -105,7 +106,7 @@ export class CreateComponent {
console.log(error);
}
else {
alert(error.json().errors[0].message);
alert(error.json().errors[0].description);
}
}
}
......
......@@ -112,6 +112,7 @@ export class RecoverComponent implements OnInit {
}
},
error => {
console.log(error);
if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
......@@ -119,7 +120,7 @@ export class RecoverComponent implements OnInit {
console.log(error);
}
else {
alert(error.json().errors[0].message);
alert(error.json().errors[0].description);
}
}
}
......
......@@ -10,7 +10,6 @@ import { ReceiveComponent } from '../receive/receive.component';
import { Observable } from 'rxjs/Rx';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/first';
@Component({
selector: 'dashboard-component',
......@@ -57,6 +56,7 @@ export class DashboardComponent {
}
},
error => {
console.log(error);
if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
......@@ -64,7 +64,7 @@ export class DashboardComponent {
console.log(error);
}
else {
alert(error.json().errors[0].message);
alert(error.json().errors[0].description);
}
}
}
......@@ -84,6 +84,7 @@ export class DashboardComponent {
}
},
error => {
console.log(error);
if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
......@@ -91,7 +92,7 @@ export class DashboardComponent {
console.log(error);
}
else {
alert(error.json().errors[0].message);
alert(error.json().errors[0].description);
}
}
}
......
......@@ -41,6 +41,7 @@ export class HistoryComponent {
}
},
error => {
console.log(error);
if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
......@@ -48,7 +49,7 @@ export class HistoryComponent {
console.log(error);
}
else {
alert(error.json().errors[0].message);
alert(error.json().errors[0].description);
}
}
}
......
......@@ -33,6 +33,7 @@ export class ReceiveComponent {
}
},
error => {
console.log(error);
if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
......@@ -40,7 +41,7 @@ export class ReceiveComponent {
console.log(error);
}
else {
alert(error.json().errors[0].message);
alert(error.json().errors[0].description);
}
}
}
......
......@@ -132,6 +132,7 @@ export class SendComponent {
}
},
error => {
console.log(error);
if (error.status === 0) {
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
......@@ -139,7 +140,7 @@ export class SendComponent {
console.log(error);
}
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