Try catch block
This commit is contained in:
+6
-1
@@ -33,7 +33,8 @@ export class ForgotPasswordComponent {
|
||||
const headers = new HttpHeaders({
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
});
|
||||
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
|
||||
try{
|
||||
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
|
||||
next: (data) => {
|
||||
if (data.trim() == "Success"){
|
||||
this.errorMsgs = ["Reset password send"];
|
||||
@@ -46,5 +47,9 @@ export class ForgotPasswordComponent {
|
||||
console.log("HTTP Error Signing In: ", err);
|
||||
}
|
||||
});
|
||||
}catch(err){
|
||||
this.errorMsgs.push("http error: " + err);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
|
||||
<div class="frame-item">
|
||||
<input type="password" [(ngModel)]="PassworR" name="Password" placeholder=" " />
|
||||
<input type="password" [(ngModel)]="PassworR" name="PassworR" placeholder=" " />
|
||||
<label>Repeat New Password</label>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user