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';
4
4
import 'package:ht_api/src/helpers/response_helper.dart' ;
5
5
import 'package:ht_api/src/services/auth_service.dart' ;
6
6
import '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' );
7
11
8
12
/// Handles POST requests to `/api/v1/auth/anonymous` .
9
13
///
@@ -37,9 +41,9 @@ Future<Response> onRequest(RequestContext context) async {
37
41
} on HtHttpException catch (_) {
38
42
// Let the central errorHandler middleware handle known exceptions
39
43
rethrow ;
40
- } catch (e) {
44
+ } catch (e, s ) {
41
45
// 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 );
43
47
// Let the central errorHandler handle this as a 500
44
48
throw const OperationFailedException (
45
49
'An unexpected error occurred during anonymous sign-in.' ,
You can’t perform that action at this time.
0 commit comments