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 @@ -4,6 +4,10 @@ import 'package:dart_frog/dart_frog.dart';
44import 'package:ht_api/src/helpers/response_helper.dart' ;
55import 'package:ht_api/src/services/auth_service.dart' ;
66import 'package:ht_shared/ht_shared.dart' ;
7+ import 'package:logging/logging.dart' ;
8+
9+ // Create a logger for this file.
10+ final _logger = Logger ('anonymous_handler' );
711
812/// Handles POST requests to `/api/v1/auth/anonymous` .
913///
@@ -37,9 +41,9 @@ Future<Response> onRequest(RequestContext context) async {
3741 } on HtHttpException catch (_) {
3842 // Let the central errorHandler middleware handle known exceptions
3943 rethrow ;
40- } catch (e) {
44+ } catch (e, s ) {
4145 // Catch unexpected errors from the service layer
42- print ('Unexpected error in /anonymous handler: $ e ' );
46+ _logger. severe ('Unexpected error in /anonymous handler' , e, s );
4347 // Let the central errorHandler handle this as a 500
4448 throw const OperationFailedException (
4549 'An unexpected error occurred during anonymous sign-in.' ,
You can’t perform that action at this time.
0 commit comments