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,6 +33,7 @@ export class ForgotPasswordComponent {
const headers = new HttpHeaders({ const headers = new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}); });
try{
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({ this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
next: (data) => { next: (data) => {
if (data.trim() == "Success"){ if (data.trim() == "Success"){
@@ -46,5 +47,9 @@ export class ForgotPasswordComponent {
console.log("HTTP Error Signing In: ", err); console.log("HTTP Error Signing In: ", err);
} }
}); });
}catch(err){
this.errorMsgs.push("http error: " + err);
}
} }
} }
@@ -9,7 +9,7 @@
</div> </div>
<div class="frame-item"> <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> <label>Repeat New Password</label>
</div> </div>