File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,17 @@ Future<void> analyze(Payload payload) async {
81
81
);
82
82
}
83
83
84
+ void warnTaskError (Exception e, StackTrace st) {
85
+ _log.warning (
86
+ 'Failed to process ${payload .package } / ${p .version }' ,
87
+ e,
88
+ st,
89
+ );
90
+ }
91
+
84
92
void shoutTaskError (Object e, StackTrace st) {
85
93
_log.shout (
86
- 'failed to process ${payload .package } / ${p .version }' ,
94
+ 'Failed to process ${payload .package } / ${p .version }' ,
87
95
e,
88
96
st,
89
97
);
@@ -120,13 +128,17 @@ Future<void> analyze(Payload payload) async {
120
128
late final map = e.bodyAsJson ();
121
129
late final error = map['error' ];
122
130
late final code = map['code' ] ?? (error is Map ? error['code' ] : null );
123
- if (e.status == 400 && code is String && code == 'TaskAborted' ) {
131
+ if (e.status >= 500 ) {
132
+ warnTaskError (e, st);
133
+ } else if (e.status == 400 && code is String && code == 'TaskAborted' ) {
124
134
warnTaskAborted (e, st);
125
135
} else {
126
136
shoutTaskError (e, st);
127
137
}
128
138
} on ApiResponseException catch (e, st) {
129
- if (e.status == 400 && e.code == 'TaskAborted' ) {
139
+ if (e.status >= 500 ) {
140
+ warnTaskError (e, st);
141
+ } else if (e.status == 400 && e.code == 'TaskAborted' ) {
130
142
warnTaskAborted (e, st);
131
143
} else {
132
144
shoutTaskError (e, st);
You can’t perform that action at this time.
0 commit comments