Try catch block

This commit is contained in:
2025-06-25 20:51:10 -07:00
parent 4ddcf88192
commit efab9bfa5d
2 changed files with 7 additions and 2 deletions
@@ -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);
}
}
}
@@ -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>