File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ import 'dart:io';
33import 'package:dart_frog/dart_frog.dart' ;
44import 'package:ht_api/src/services/auth_service.dart' ;
55import 'package:ht_shared/ht_shared.dart' ; // For User and exceptions
6+ import 'package:logging/logging.dart' ;
7+
8+ // Create a logger for this file.
9+ final _logger = Logger ('delete_account_handler' );
610
711/// Handles DELETE requests to `/api/v1/auth/delete-account` .
812///
@@ -38,10 +42,12 @@ Future<Response> onRequest(RequestContext context) async {
3842 } on HtHttpException catch (_) {
3943 // Let the central errorHandler middleware handle known exceptions
4044 rethrow ;
41- } catch (e) {
45+ } catch (e, s ) {
4246 // Catch unexpected errors from the service layer
43- print (
44- 'Unexpected error in /delete-account handler for user ${user .id }: $e ' ,
47+ _logger.severe (
48+ 'Unexpected error in /delete-account handler for user ${user .id }' ,
49+ e,
50+ s,
4551 );
4652 // Let the central errorHandler handle this as a 500
4753 throw const OperationFailedException (
You can’t perform that action at this time.
0 commit comments