import 'app_exception.dart';

class AuthException extends AppException {
  final int statusCode;

  const AuthException({
    required this.statusCode,
    required super.userMessage,
    super.technicalDetails,
  }) : super(allowRetry: false);

  factory AuthException.unauthorized({String? technicalDetails}) =>
      AuthException(
        statusCode: 401,
        userMessage: 'Bitte melde dich erneut an, um fortzufahren.',
        technicalDetails: technicalDetails,
      );

  factory AuthException.forbidden({String? technicalDetails}) => AuthException(
    statusCode: 403,
    userMessage: 'Du hast keine Berechtigung für diese Aktion.',
    technicalDetails: technicalDetails,
  );
}
