fixed httpclient error logging
This commit is contained in:
parent
3e8767e481
commit
49bd7d2e0c
4 changed files with 6 additions and 34 deletions
|
@ -105,23 +105,17 @@ export class AccountEditComponent implements OnInit {
|
|||
.accountEditUpdate(submitData)
|
||||
.subscribe(
|
||||
result => {
|
||||
console.log('data submitted!');
|
||||
this.submitStatus = 'success';
|
||||
console.log(this.submitStatus);
|
||||
},
|
||||
error => {
|
||||
console.log('Edit Error');
|
||||
console.log(error);
|
||||
try {
|
||||
console.log(error.error);
|
||||
const jsonError = error.json();
|
||||
console.log('boop');
|
||||
this.submitStatusError = '"' + jsonError.error + '" Error, ' + jsonError.message;
|
||||
this.submitStatusError = '"' + error.error.error + '" Error, ' + error.error.message;
|
||||
} catch (e) {
|
||||
this.submitStatusError = 'There was a server error, please try again later.';
|
||||
}
|
||||
this.submitStatus = 'send_failed';
|
||||
console.log(this.submitStatus);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -131,7 +125,6 @@ export class AccountEditComponent implements OnInit {
|
|||
if (!this.settingForm.valid && !this.settingCustomerForm.valid) {
|
||||
console.log('Not Valid!');
|
||||
this.submitStatus = 'validation_failed';
|
||||
console.log(this.submitStatus);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -247,8 +247,7 @@ export class AddDataComponent implements OnInit {
|
|||
console.log(error);
|
||||
try {
|
||||
console.log(error.error);
|
||||
const jsonError = error.json();
|
||||
this.transactionFormStatusError = '"' + jsonError.error + '" Error, ' + jsonError.message;
|
||||
this.transactionFormStatusError = '"' + error.error.error + '" Error, ' + error.error.message;
|
||||
} catch (e) {
|
||||
this.transactionFormStatusError = 'There was a server error, please try again later.';
|
||||
}
|
||||
|
|
|
@ -55,9 +55,7 @@ export class FeedbackComponent implements OnInit {
|
|||
result => {
|
||||
if ( result.success === true ) {
|
||||
console.log('Successful Upload');
|
||||
console.log(result);
|
||||
this.feedbackFormStatus = 'success';
|
||||
console.log(this.feedbackFormStatus);
|
||||
this.feedbackForm.patchValue({
|
||||
feedbacktext: '',
|
||||
});
|
||||
|
@ -65,22 +63,16 @@ export class FeedbackComponent implements OnInit {
|
|||
console.log('Upload Error');
|
||||
this.feedbackFormStatusError = JSON.stringify(result.status) + 'Error, ' + JSON.stringify(result.message);
|
||||
this.feedbackFormStatus = 'send_failed';
|
||||
console.log(this.feedbackFormStatus);
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('Upload Error');
|
||||
console.log(error);
|
||||
try {
|
||||
console.log(error.error);
|
||||
const jsonError = error.json();
|
||||
console.log('boop');
|
||||
this.feedbackFormStatusError = '"' + jsonError.error + '" Error, ' + jsonError.message;
|
||||
this.feedbackFormStatusError = '"' + error.error.error + '" Error, ' + error.error.message;
|
||||
} catch (e) {
|
||||
this.feedbackFormStatusError = 'There was a server error, please try again later.';
|
||||
}
|
||||
this.feedbackFormStatus = 'send_failed';
|
||||
console.log(this.feedbackFormStatus);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Reference in a new issue