File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ import 'package:ht_api/src/helpers/response_helper.dart';
55import 'package:ht_api/src/services/auth_service.dart' ;
66// Import exceptions, User, SuccessApiResponse, AND AuthSuccessResponse
77import 'package:ht_shared/ht_shared.dart' ;
8+ import 'package:logging/logging.dart' ;
9+
10+ // Create a logger for this file.
11+ final _logger = Logger ('verify_code_handler' );
812
913/// Handles POST requests to `/api/v1/auth/verify-code` .
1014///
@@ -105,9 +109,9 @@ Future<Response> onRequest(RequestContext context) async {
105109 // Let the central errorHandler middleware handle known exceptions
106110 // (e.g., InvalidInputException if code is wrong/expired)
107111 rethrow ;
108- } catch (e) {
112+ } catch (e, s ) {
109113 // Catch unexpected errors from the service layer
110- print ('Unexpected error in /verify-code handler: $ e ' );
114+ _logger. severe ('Unexpected error in /verify-code handler' , e, s );
111115 // Let the central errorHandler handle this as a 500
112116 throw const OperationFailedException (
113117 'An unexpected error occurred while verifying the sign-in code.' ,
You can’t perform that action at this time.
0 commit comments