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';
5
5
import 'package:ht_api/src/services/auth_service.dart' ;
6
6
// Import exceptions, User, SuccessApiResponse, AND AuthSuccessResponse
7
7
import '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' );
8
12
9
13
/// Handles POST requests to `/api/v1/auth/verify-code` .
10
14
///
@@ -105,9 +109,9 @@ Future<Response> onRequest(RequestContext context) async {
105
109
// Let the central errorHandler middleware handle known exceptions
106
110
// (e.g., InvalidInputException if code is wrong/expired)
107
111
rethrow ;
108
- } catch (e) {
112
+ } catch (e, s ) {
109
113
// 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 );
111
115
// Let the central errorHandler handle this as a 500
112
116
throw const OperationFailedException (
113
117
'An unexpected error occurred while verifying the sign-in code.' ,
You can’t perform that action at this time.
0 commit comments