File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 4
4
import 'dart:io' ;
5
5
6
6
import 'package:dart_frog/dart_frog.dart' ;
7
- import 'package:ht_http_client/ht_http_client .dart' ;
7
+ import 'package:ht_shared/ht_shared .dart' ;
8
8
9
9
/// Middleware that catches errors and converts them into
10
10
/// standardized JSON responses.
@@ -70,6 +70,7 @@ int _mapExceptionToStatusCode(HtHttpException exception) {
70
70
ServerException () => HttpStatus .internalServerError, // 500
71
71
NetworkException () => HttpStatus .serviceUnavailable, // 503 (or 500)
72
72
UnknownException () => HttpStatus .internalServerError, // 500
73
+ _ => HttpStatus .internalServerError,
73
74
};
74
75
}
75
76
@@ -81,7 +82,9 @@ String _mapExceptionToCodeString(HtHttpException exception) {
81
82
ForbiddenException () => 'FORBIDDEN' ,
82
83
NotFoundException () => 'NOT_FOUND' ,
83
84
ServerException () => 'SERVER_ERROR' ,
84
- NetworkException () => 'NETWORK_ERROR' , // Or 'SERVICE_UNAVAILABLE'
85
+ NetworkException () => 'NETWORK_ERROR' ,
85
86
UnknownException () => 'UNKNOWN_ERROR' ,
87
+ _ => 'UNKNOWN_ERROR' ,
88
+
86
89
};
87
90
}
Original file line number Diff line number Diff line change @@ -14,6 +14,15 @@ dependencies:
14
14
# ht_countries_inmemory:
15
15
# git:
16
16
# url: https://github.com/headlines-toolkit/ht-countries-inmemory.git
17
+ ht_app_settings_client :
18
+ git :
19
+ url : https://github.com/headlines-toolkit/ht-app-settings-client.git
20
+ ht_app_settings_inmemory :
21
+ git :
22
+ url : https://github.com/headlines-toolkit/ht-app-settings-inmemory.git
23
+ ht_app_settings_repository :
24
+ git :
25
+ url : https://github.com/headlines-toolkit/ht-app-settings-repository.git
17
26
ht_data_client :
18
27
git :
19
28
url : https://github.com/headlines-toolkit/ht-data-client.git
You can’t perform that action at this time.
0 commit comments