Use markdown for all errors
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
bf83c87552
commit
26cc78334a
1 changed files with 4 additions and 1 deletions
|
@ -59,9 +59,11 @@ async fn paste_render(data: Data<Template>, paste: Query<Paste>) -> impl Respond
|
|||
if response_code != "200" {
|
||||
let resp_struct: GitLabFailedJSON = serde_json::from_str(&response_json).unwrap();
|
||||
if resp_struct.message == "404 Project Not Found" {
|
||||
context.insert("md", "true");
|
||||
paste_content = "Project ID Mismatch/GitLab Token Missing".to_string();
|
||||
}
|
||||
else {
|
||||
context.insert("md", "true");
|
||||
paste_content = "Paste ID is Invalid".to_string();
|
||||
}
|
||||
} else {
|
||||
|
@ -74,7 +76,8 @@ async fn paste_render(data: Data<Template>, paste: Query<Paste>) -> impl Respond
|
|||
.unwrap();
|
||||
}
|
||||
} else {
|
||||
paste_content = "This is a no-nonsense Pastebin Server, written in Rust. It serves the content from files on a GitLab Private Repository. Please look into the repository for hosting your own copy of this".to_string();
|
||||
context.insert("md", "true");
|
||||
paste_content = "This is a no-nonsense Pastebin Server, written in Rust. It serves the content from files on a GitLab Private Repository. Please look into the repository for hosting your own copy of this.".to_string();
|
||||
}
|
||||
context.insert("paste_content", &paste_content);
|
||||
if paste.parse_md.is_some() {
|
||||
|
|
Loading…
Reference in a new issue