File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: github:: { self , WorkflowRunJob } ;
2
2
use crate :: handlers:: Context ;
3
+ use crate :: interactions:: REPORT_TO ;
3
4
use crate :: utils:: AppError ;
4
5
use anyhow:: Context as _;
5
6
use axum:: extract:: { Path , State } ;
@@ -272,6 +273,8 @@ body {{
272
273
</style>
273
274
<script type="module" nonce="{nonce}">
274
275
import {{ AnsiUp }} from '{ANSI_UP_URL}'
276
+
277
+ try {{
275
278
276
279
const logs = {logs};
277
280
const tree_roots = {tree_roots};
@@ -348,6 +351,11 @@ body {{
348
351
inline: hasSmallViewport ? 'start' : 'center'
349
352
}});
350
353
}}
354
+
355
+ }} catch (e) {{
356
+ console.error(e);
357
+ document.body.innerText = `Something went wrong: ${{e}}\n\n{REPORT_TO}`;
358
+ }}
351
359
</script>
352
360
</head>
353
361
<body>
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ use crate::{
8
8
} ;
9
9
use std:: fmt:: Write ;
10
10
11
+ pub const REPORT_TO : & str = "Please file an issue on GitHub at [triagebot](https://github.com/rust-lang/triagebot) if there's \
12
+ a problem with this bot, or reach out on [#triagebot](https://rust-lang.zulipchat.com/#narrow/channel/224082-triagebot) on Zulip.";
13
+
11
14
pub struct ErrorComment < ' a > {
12
15
issue : & ' a Issue ,
13
16
message : String ,
@@ -28,11 +31,7 @@ impl<'a> ErrorComment<'a> {
28
31
let mut body = String :: new ( ) ;
29
32
writeln ! ( body, "**Error**: {message}" ) ?;
30
33
writeln ! ( body) ?;
31
- writeln ! (
32
- body,
33
- "Please file an issue on GitHub at [triagebot](https://github.com/rust-lang/triagebot) if there's \
34
- a problem with this bot, or reach out on [#t-infra](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra) on Zulip."
35
- ) ?;
34
+ writeln ! ( body, "{REPORT_TO}" ) ?;
36
35
Ok ( body)
37
36
}
38
37
Original file line number Diff line number Diff line change
1
+ use crate :: interactions:: REPORT_TO ;
2
+
1
3
use axum:: {
2
4
http:: StatusCode ,
3
5
response:: { IntoResponse , Response } ,
@@ -20,7 +22,7 @@ impl IntoResponse for AppError {
20
22
tracing:: error!( "{:?}" , & self . 0 ) ;
21
23
(
22
24
StatusCode :: INTERNAL_SERVER_ERROR ,
23
- format ! ( "Something went wrong: {}" , self . 0 ) ,
25
+ format ! ( "Something went wrong: {}\n \n {REPORT_TO} " , self . 0 ) ,
24
26
)
25
27
. into_response ( )
26
28
}
You can’t perform that action at this time.
0 commit comments