From 99f69d25c4ab0a99241ce541c42b819cfb8f82bc Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 7 Sep 2025 12:47:12 +0200 Subject: [PATCH] WIP --- src/app/services/auth.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index b0c594a..26bf98e 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; import { Router } from "@angular/router"; +import { of } from 'rxjs'; @Injectable({ providedIn: 'root' @@ -10,7 +11,12 @@ export class AuthService { constructor(private router : Router) { } login(username : string, password : string) { + const shouldFail = Math.random() < 0.3; // 30% Fehlerchance + if (shouldFail) { + throw new Error('Simulierter Fehler im Service'); + } this.username = username; + return of(username); } assertUserIsKnown(): void { -- 2.20.1